summaryrefslogtreecommitdiff
path: root/quota_nld.c
diff options
context:
space:
mode:
authorPetr Písař <ppisar@redhat.com>2011-08-17 16:16:12 +0200
committerJan Kara <jack@suse.cz>2011-08-17 23:47:26 +0200
commit7d2ac8097d65c6698124abd2dda25bffd8590aa7 (patch)
treee4285720ade198103e49e42511b37a813bca242d /quota_nld.c
parent590d0dd9c551bf94abd377ddc55b050a2c381c5b (diff)
Do not report missing utmp record to syslog
If no utmp record can be found there is obviously nobody to read error message about missing TTY in sytem log in real time. Moreover the log is usually illegible for normal user. So it's pointless to log this fact there for user's sake. warnquota can be used instead. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'quota_nld.c')
-rw-r--r--quota_nld.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/quota_nld.c b/quota_nld.c
index de9504e..5a53b7e 100644
--- a/quota_nld.c
+++ b/quota_nld.c
@@ -264,7 +264,12 @@ static void write_console_warning(struct quota_warning *warn)
}
}
if (!max_atime) {
- errstr(_("Failed to find tty of user %llu to report warning to.\n"), (unsigned long long)warn->caused_id);
+ /*
+ * This can happen quite easily so don't spam syslog with
+ * the error
+ */
+ if (flags & FL_NODAEMON)
+ errstr(_("Failed to find tty of user %llu to report warning to.\n"), (unsigned long long)warn->caused_id);
return;
}
fd = open(max_dev, O_WRONLY);