]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(vsyslog): Don't try to send if not connected to syslog daemon.
authorUlrich Drepper <drepper@redhat.com>
Tue, 10 Mar 1998 21:30:32 +0000 (21:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 10 Mar 1998 21:30:32 +0000 (21:30 +0000)
(closelog_internal): Don't do anything if not connected.

misc/syslog.c

index 91a1e0910d15c5e9cf7aff29f3c86f62e9761c8d..c58639ee30fd3bbca1a283c2d928bea79183e8b1 100644 (file)
@@ -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;