]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 10 Mar 1998 20:32:27 +0000 (20:32 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 10 Mar 1998 20:32:27 +0000 (20:32 +0000)
1998-03-10  Ulrich Drepper  <drepper@cygnus.com>

* libio/iovdprintf.c (_IO_vdprintf): Set _IO_DELETE_DONT_CLOSE
flag.

* misc/syslog.c (vsyslog): Don't try to send if not connected to
syslog daemon.
(closelog_internal): Don't do anything if not connected.

ChangeLog
libio/iovdprintf.c
misc/syslog.c

index 010408a31fa2a1efb1acdaf86420dce037d106b3..f803ee20f0c647e57fdbb27f4cc033d602d6514a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1998-03-10  Ulrich Drepper  <drepper@cygnus.com>
+
+       * libio/iovdprintf.c (_IO_vdprintf): Set _IO_DELETE_DONT_CLOSE
+       flag.
+
+       * misc/syslog.c (vsyslog): Don't try to send if not connected to
+       syslog daemon.
+       (closelog_internal): Don't do anything if not connected.
+
 1998-03-10 17:54  Ulrich Drepper  <drepper@cygnus.com>
 
        * libc.map: Add _dl_debug_message.
index a24d3b535e8e9393991ecf59eb8567aaafb33fa4..d95af4742fb595af312624fde81d9b8a2a0b87a3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -52,11 +52,10 @@ _IO_vdprintf (d, format, arg)
       _IO_un_link (&tmpfil.file);
       return EOF;
     }
-  tmpfil.file._flags &= ~_IO_DELETE_DONT_CLOSE;
-
   tmpfil.file._IO_file_flags =
-    _IO_mask_flags (&tmpfil.file, _IO_NO_READS,
-                   _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
+    (_IO_mask_flags (&tmpfil.file, _IO_NO_READS,
+                    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING)
+     | _IO_DELETE_DONT_CLOSE);
 
   done = _IO_vfprintf (&tmpfil.file, format, arg);
 
index 090926a2c5a1a103a641f844b2fdc391da26c16a..0aaabfa170b74a5a957ea070efa4e4bbf55f636e 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 */
            /*
@@ -245,7 +245,7 @@ openlog_internal(const char *ident, int logstat, int logfac)
                        (void)strncpy(SyslogAddr.sa_data, _PATH_LOG,
                                      sizeof(SyslogAddr.sa_data));
                        if (LogStat & LOG_NDELAY) {
-                               if ((LogFile = socket(AF_UNIX, LogType, 0))
+                               if ((LogFile = __socket(AF_UNIX, LogType, 0))
                                    == -1)
                                        return;
                                (void)fcntl(LogFile, F_SETFD, 1);
@@ -292,15 +292,18 @@ openlog (const char *ident, int logstat, int logfac)
 static void
 sigpipe_handler (int signo)
 {
-       closelog_internal();
+  closelog_internal ();
 }
 
 static void
 closelog_internal()
 {
-       (void)close(LogFile);
-       LogFile = -1;
-       connected = 0;
+  if (!connected)
+    return;
+
+  close (LogFile);
+  LogFile = -1;
+  connected = 0;
 }
 
 void
This page took 0.053809 seconds and 5 git commands to generate.