When writing log files ignore errors caused by filled up disks so that
authorJoey Schulze <joey@infodrom.org>
Thu, 24 May 2007 13:28:18 +0000 (13:28 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 24 May 2007 13:28:18 +0000 (13:28 +0000)
the log continues to be written as soon as space becomes available again.

syslogd.c

index 72df0db..5853c21 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -480,6 +480,10 @@ static char sccsid[] = "@(#)syslogd.c      5.27 (Berkeley) 10/10/88";
  *     restart code, so that subsequent SIGHUPs are able to set it
  *     again and cause a new restart.  This fixes a race condition
  *     when somebody sends tons of HUP signals.
+ * Thu May 24 15:24:49 CEST 2007: Martin Schulze <joey@infodrom.org>
+ *     Ignore errors caused by filled up disks so that the log
+ *     continues to be written as soon as space becomes available
+ *     again.
  */
 
 
@@ -1907,6 +1911,12 @@ void fprintlog(f, from, flags, msg)
                        if (f->f_type == F_PIPE && e == EAGAIN)
                                break;
 
+                       /* If the filesystem is filled up, just ignore
+                          it for now and continue writing when
+                          possible */
+                       if (f->f_type == F_FILE && e == ENOSPC)
+                               break;
+
                        (void) close(f->f_file);
                        /*
                         * Check for EBADF on TTY's due to vhangup() XXX