From: Dave Hart Date: Fri, 12 Aug 2011 06:25:53 +0000 (+0000) Subject: Correct init_logging()'s def_syslogmask type to u_int32 following X-Git-Tag: NTP_4_2_7P203~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19d7d49dd07f9c67bbba82c11ed68894ef13159c;p=thirdparty%2Fntp.git Correct init_logging()'s def_syslogmask type to u_int32 following change of ntp_syslogmask from u_long to u_int32 in p202. bk: 4e44c7715nAY03wRe8Je1gTwe2Halw --- diff --git a/ChangeLog b/ChangeLog index d31a6180d..4e6d13084 100644 --- 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 * [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. diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 451c16f15..390eefc1a 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -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 diff --git a/libntp/msyslog.c b/libntp/msyslog.c index 202647122..2953569b5 100644 --- a/libntp/msyslog.c +++ b/libntp/msyslog.c @@ -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 */ /* diff --git a/sntp/m4/ntp_libevent.m4 b/sntp/m4/ntp_libevent.m4 index 2d31d1dc8..953f2ef92 100644 --- a/sntp/m4/ntp_libevent.m4 +++ b/sntp/m4/ntp_libevent.m4 @@ -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]) ;; *)