From: Ulrich Drepper Date: Tue, 10 Mar 1998 21:30:32 +0000 (+0000) Subject: (vsyslog): Don't try to send if not connected to syslog daemon. X-Git-Tag: cvs/before-sparc-2_0_x-branch~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a5ab3cdc074cc7d08e27e628d9083d07afdabd2;p=thirdparty%2Fglibc.git (vsyslog): Don't try to send if not connected to syslog daemon. (closelog_internal): Don't do anything if not connected. --- diff --git a/misc/syslog.c b/misc/syslog.c index 91a1e0910d1..c58639ee30f 100644 --- a/misc/syslog.c +++ b/misc/syslog.c @@ -201,7 +201,7 @@ vsyslog(pri, fmt, ap) if (LogType == SOCK_STREAM) ++bufsize; - if (__send(LogFile, buf, bufsize, 0) < 0) + if (!connected || __send(LogFile, buf, bufsize, 0) < 0) { closelog_internal (); /* attempt re-open next time */ /* @@ -297,6 +297,8 @@ sigpipe_handler (int signo) static void closelog_internal() { + if (!connected) + return; (void)close(LogFile); LogFile = -1; connected = 0;