about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-10 21:30:32 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-10 21:30:32 +0000
commit7a5ab3cdc074cc7d08e27e628d9083d07afdabd2 (patch)
treea4de41cc3913ff5a5720cf92e3557f0ba0899833 /misc
parent31497e656ee15ba1a85c4079ba30ad9765420e82 (diff)
downloadglibc-7a5ab3cdc074cc7d08e27e628d9083d07afdabd2.tar.gz
glibc-7a5ab3cdc074cc7d08e27e628d9083d07afdabd2.tar.xz
glibc-7a5ab3cdc074cc7d08e27e628d9083d07afdabd2.zip
(vsyslog): Don't try to send if not connected to syslog daemon.
(closelog_internal): Don't do anything if not connected.
Diffstat (limited to 'misc')
-rw-r--r--misc/syslog.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/syslog.c b/misc/syslog.c
index 91a1e0910d..c58639ee30 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;