When writing log files ignore errors caused by filled up disks so that

the log continues to be written as soon as space becomes available again.
This commit is contained in:
Joey Schulze 2007-05-24 13:28:18 +00:00
parent 29fe6a66e0
commit 8ead571ba1

View File

@ -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