bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

server.c uses syslog() without preprocessor condition


From: Terrence Enger
Subject: server.c uses syslog() without preprocessor condition
Date: Thu, 09 Oct 2003 21:01:03 -0400

Greetings,

I notice that server.c since rev 1.318 (2003-10-01 17:11Z)
has four references to syslog() not conditioned by the
ususal preprocessor condition.  In case the omission of the
preprocessor conditions is accidental, I offer the following
patch.

Thank you, all, for your attention.

I grant permission to distribute this patch under the terms
of the GNU Public Licence.

Terry.
Available for contract programming.


Index: src/ChangeLog
===================================================================
RCS file: /home/cvs/cvs400/src/ChangeLog,v
retrieving revision 1.19
retrieving revision 1.20
diff --context=5 -r1.19 -r1.20
*** src/ChangeLog       9 Oct 2003 17:20:33 -0000       1.19
--- src/ChangeLog       10 Oct 2003 00:42:25 -0000      1.20
***************
*** 1,5 ****
--- 1,10 ----
+ 2003-10-09  Terrence Enger  <address@hidden>
+ 
+       * server.c (cvs_output, cvs_outerr): Protect calls to syslog()
+       with the usual preprocessor condition: HAVE_SYSLOG_H.
+ 
  2003-10-08  Derek Price  <address@hidden>
  
        * Makefile.am (cvs_SOURCES): Add history.h.
        * history.c: Include history.h.  Add the `P' record types to more
        comments. s/ALL_REC_TYPES/ALL_HISTORY_REC_TYPES/.
Index: src/server.c
===================================================================
RCS file: /home/cvs/cvs400/src/server.c,v
retrieving revision 1.9
retrieving revision 1.11
diff --context=5 -r1.9 -r1.11
*** src/server.c        9 Oct 2003 17:20:33 -0000       1.9
--- src/server.c        10 Oct 2003 00:29:51 -0000      1.11
***************
*** 6105,6132 ****
--- 6105,6140 ----
        {
            buf_output (saved_output, str, len);
            buf_copy_lines (buf_to_net, saved_output, 'M');
        }
        else
+       {
+ # if HAVE_SYSLOG_H
            syslog (LOG_DAEMON | LOG_ERR,
                    "Attempt to write message after close of network buffer.  "
                    "Message was: %s",
                    str);
+ # endif
+       }
      }
      else if (server_active)
      {
        if (protocol)
        {
            buf_output (saved_output, str, len);
            buf_copy_lines (protocol, saved_output, 'M');
            buf_send_counted (protocol);
        }
        else
+       {
+ # if HAVE_SYSLOG_H
            syslog (LOG_DAEMON | LOG_ERR,
                    "Attempt to write message before initialization of "
                    "protocol buffer.  Message was: %s",
                    str);
+ # endif
+       }
      }
      else
  #endif
      {
        size_t written;
***************
*** 6249,6276 ****
--- 6257,6292 ----
        {
            buf_output (saved_outerr, str, len);
            buf_copy_lines (buf_to_net, saved_outerr, 'E');
        }
        else
+       {
+ # if HAVE_SYSLOG_H
            syslog (LOG_DAEMON | LOG_ERR,
                    "Attempt to write error message after close of network "
                    "buffer.  Message was: %s",
                    str);
+ # endif
+       }
      }
      else if (server_active)
      {
        if (protocol)
        {
            buf_output (saved_outerr, str, len);
            buf_copy_lines (protocol, saved_outerr, 'E');
            buf_send_counted (protocol);
        }
        else
+       {
+ # if HAVE_SYSLOG_H
            syslog (LOG_DAEMON | LOG_ERR,
                    "Attempt to write error message before initialization of "
                    "protocol buffer.  Message was: %s",
                    str);
+ # endif
+       }
      }
      else
  #endif
      {
        size_t written;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]