]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Correct init_logging()'s def_syslogmask type to u_int32 following
authorDave Hart <hart@ntp.org>
Fri, 12 Aug 2011 06:25:53 +0000 (06:25 +0000)
committerDave Hart <hart@ntp.org>
Fri, 12 Aug 2011 06:25:53 +0000 (06:25 +0000)
  change of ntp_syslogmask from u_long to u_int32 in p202.

bk: 4e44c7715nAY03wRe8Je1gTwe2Halw

ChangeLog
include/ntp_stdlib.h
libntp/msyslog.c
sntp/m4/ntp_libevent.m4

index d31a6180da128dfaabf2783d2ae720c4012c2dea..4e6d1308454c282f416086eb4692c7b04ec11608 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 * Fix make distcheck with --enable-libevent-regress problem with
   unwritable $srcdir.
+* Correct init_logging()'s def_syslogmask type to u_int32 following
+  change of ntp_syslogmask from u_long to u_int32 in p202.
 (4.2.7p202) 2011/08/09 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1983] --without-sntp build breaks in sntp subdir.
 * [Bug 1984] from 4.2.6p4-RC3: ntp/libisc fails to compile on OS X 10.7.
index 451c16f1522f4106c94be4789bcc121ad95185c5..390eefc1ae3fc3df2428d164c49ad1c256ccada9 100644 (file)
@@ -49,7 +49,7 @@ extern        int     msnprintf(char *, size_t, const char *, ...)
                        __attribute__((__format__(__printf__, 3, 4)));
 extern void    msyslog(int, const char *, ...)
                        __attribute__((__format__(__printf__, 2, 3)));
-extern void    init_logging    (const char *, u_long, int);
+extern void    init_logging    (const char *, u_int32, int);
 extern int     change_logfile  (const char *, int);
 extern void    setup_logfile   (const char *);
 #ifndef errno_to_str
index 202647122170c3009cc6e68ffa5ee60499597620..2953569b577a725258c5bb46f96d0d16ff9d8de0 100644 (file)
@@ -32,7 +32,9 @@ FILE *        syslog_file;
 char * syslog_fname;
 char * syslog_abs_fname;
 
-u_int32 ntp_syslogmask =  ~(u_int32)0; /* libntp default is all lit */
+/* libntp default ntp_syslogmask is all bits lit */
+#define INIT_NTP_SYSLOGMASK    ~(u_int32)0
+u_int32 ntp_syslogmask = INIT_NTP_SYSLOGMASK;
 
 extern char *  progname;
 
@@ -361,7 +363,7 @@ msyslog(
 void
 init_logging(
        const char *    name,
-       u_long          def_syslogmask,
+       u_int32         def_syslogmask,
        int             is_daemon
        )
 {
@@ -378,8 +380,10 @@ init_logging(
         * that ntp_syslogmask is still at its default from libntp,
         * keeping in mind this function is called in forked children
         * where it has already been called in the parent earlier.
+        * Forked children pass 0 for def_syslogmask.
         */
-       if (~(u_long)0 == ntp_syslogmask && 0 != def_syslogmask)
+       if (INIT_NTP_SYSLOGMASK == ntp_syslogmask &&
+           0 != def_syslogmask)
                ntp_syslogmask = def_syslogmask; /* set more via logconfig */
 
        /*
index 2d31d1dc856443183baebfd1f09d18881f916c85..953f2ef92e84df6768eef352f2434ce3f8db20e3 100644 (file)
@@ -112,12 +112,17 @@ esac
 
 case "$ntp_use_local_libevent" in
  yes)
-    dnl ac_configure_args is undocumented but widely abused.
+    dnl ac_configure_args is undocumented but widely abused, as here,
+    dnl to modify the defaults of the libevent subpackage, by prefixing
+    dnl our changes to the child configure arguments already assembled.
+    dnl User-supplied contradictory choices should prevail thanks to
+    dnl "last wins".
     ac_configure_args=" --disable-openssl${ac_configure_args}"
     ac_configure_args=" --disable-shared${ac_configure_args}"
     ac_configure_args=" --disable-libevent-regress${ac_configure_args}"
     ac_configure_args=" --disable-libevent-install${ac_configure_args}"
     ac_configure_args=" --enable-silent-rules${ac_configure_args}"
+    ac_configure_args=" --enable-function-sections${ac_configure_args}"
     AC_CONFIG_SUBDIRS([libevent])
     ;;
  *)