From: Bruce Korb Date: Sat, 31 Dec 2005 00:09:52 +0000 (-0800) Subject: Warning patrol, mostly. Also ensure that $(top_srcdir)/version is built X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d523bcaf8692cda8b9e04ec707a6fc18041fea;p=thirdparty%2Fntp.git Warning patrol, mostly. Also ensure that $(top_srcdir)/version is built in those subdirectories that need it. bk: 43b5cc50sVO9zjY1Upxz0mgTn688_g --- diff --git a/bootstrap b/bootstrap index 3c29f25c2b..ed92a58cf8 100755 --- a/bootstrap +++ b/bootstrap @@ -34,7 +34,7 @@ gunzip -c $(autoopts-config --libsrc) | ( cd sntp tar -xvf - mv libopts-*.*.* libopts ) -mv -f sntp/libopts/m4/libopts.m4 m4/libopts.m4 +mv -f sntp/libopts/libopts.m4 m4/libopts.m4 prog_opt_files=$( egrep -l '^prog.name' $( diff --git a/include/debug-opt.def b/include/debug-opt.def index bd426bec0f..783e5b0b1f 100755 --- a/include/debug-opt.def +++ b/include/debug-opt.def @@ -1,4 +1,12 @@ +include = <<- _EOF_ + #ifdef __windows + extern int atoi(const char*); + #else + # include + #endif + _EOF_; + flag = { name = debug-level; value = d; diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index 95b15507a6..27890c63ab 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -91,6 +91,9 @@ $(PROGRAMS): $(LDADD) ../libparse/libparse.a: cd ../libparse && $(MAKE) +$(top_srcdir)/version : + cd $(top_srcdir) && $(MAKE) version + version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpd $(COMPILE) -c version.c diff --git a/ntpd/cmd_args.c b/ntpd/cmd_args.c index 29b29ab312..d0bbebea2f 100644 --- a/ntpd/cmd_args.c +++ b/ntpd/cmd_args.c @@ -20,6 +20,7 @@ * Definitions of things either imported from or exported to outside */ extern char const *progname; +extern const char *specific_interface; extern int default_ai_family; diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index fcb9562543..63e683c164 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -156,7 +156,7 @@ volatile int debug = 0; /* No debugging by default */ #endif int listen_to_virtual_ips = 1; -char *specific_interface = NULL; /* interface name or IP address to bind to */ +const char *specific_interface = NULL; /* interface name or IP address to bind to */ /* * No-fork flag. If set, we do not become a background daemon. @@ -213,14 +213,14 @@ static RETSIGTYPE no_debug P((int)); int ntpdmain P((int, char **)); static void set_process_priority P((void)); -static void init_logging P((char *)); +static void init_logging P((char const *)); static void setup_logfile P((void)); /* * Initialize the logging */ void -init_logging(char *name) +init_logging(char const *name) { char *cp; @@ -230,7 +230,7 @@ init_logging(char *name) */ cp = strrchr(name, '/'); if (cp == 0) - cp = name; + cp = (char*)name; else cp++; @@ -268,18 +268,18 @@ setup_logfile( ) { if (HAVE_OPT( LOGFILE )) { - char *ntp_optarg = OPT_ARG( LOGFILE ); + const char *optarg = OPT_ARG( LOGFILE ); FILE *new_file; - if(strcmp(ntp_optarg, "stderr") == 0) + if(strcmp(optarg, "stderr") == 0) new_file = stderr; - else if(strcmp(ntp_optarg, "stdout") == 0) + else if(strcmp(optarg, "stdout") == 0) new_file = stdout; else - new_file = fopen(ntp_optarg, "a"); + new_file = fopen(optarg, "a"); if (new_file != NULL) { NLOG(NLOG_SYSINFO) - msyslog(LOG_NOTICE, "logging to file %s", ntp_optarg); + msyslog(LOG_NOTICE, "logging to file %s", optarg); if (syslog_file != NULL && fileno(syslog_file) != fileno(new_file)) (void)fclose(syslog_file); @@ -290,7 +290,7 @@ setup_logfile( else msyslog(LOG_ERR, "Cannot open log file %s", - ntp_optarg); + optarg); } } @@ -525,7 +525,7 @@ printf("1: argc=%d\n", argc); init_winnt_time(); #endif - /* getstartup(argc, argv); /* startup configuration, may set debug */ + /* getstartup(argc, argv); / * startup configuration, may set debug */ #ifdef DEBUG debug = DESC(DEBUG_LEVEL).optOccCt; diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index 61920262cd..c6ef27d3e2 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -18,6 +18,9 @@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) +$(top_srcdir)/version : + cd $(top_srcdir) && $(MAKE) version + version.o: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdate $(COMPILE) -c version.c diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am index c6d86ee758..c08aaa1a1f 100644 --- a/ntpdc/Makefile.am +++ b/ntpdc/Makefile.am @@ -46,6 +46,9 @@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) +$(top_srcdir)/version : + cd $(top_srcdir) && $(MAKE) version + version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc $(COMPILE) -c version.c diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index fc6f905355..3f0d42b478 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -29,6 +29,9 @@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) +$(top_srcdir)/version : + cd $(top_srcdir) && $(MAKE) version + version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpq $(COMPILE) -c version.c