From: Harlan Stenn Date: Wed, 10 Oct 2012 03:19:59 +0000 (-0400) Subject: [Bug 1374] Support SO_TIMESTAMPNS X-Git-Tag: NTP_4_2_7P311~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2382e4db5572cbbd2d3e752ea141b706c419036;p=thirdparty%2Fntp.git [Bug 1374] Support SO_TIMESTAMPNS bk: 5074e95f5nCCmJimO0aLIneU3YYQlw --- diff --git a/ChangeLog b/ChangeLog index 6eb8697ba..4f01c8758 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1374] Support SO_TIMESTAMPNS. * [Bug 1013] ntpdate's HTML page claims wrong default version. * [Bug 1374] Support SO_TIMESTAMPNS. * [Bug 2266] Remove deprecated refclock_trak.c from Windows Makefile diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 2bc6b38f6..e58a1dbce 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -255,7 +255,7 @@ main( progname = argv[0]; parse_cmdline_opts(&argc, &argv); #ifdef DEBUG - debug = DESC(DEBUG_LEVEL).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; DPRINTF(1, ("%s\n", Version)); #endif @@ -453,7 +453,7 @@ ntpdmain( initializing = TRUE; /* mark that we are initializing */ parse_cmdline_opts(&argc, &argv); # ifdef DEBUG - debug = DESC(DEBUG_LEVEL).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; # endif if (HAVE_OPT(NOFORK) || HAVE_OPT(QUIT) diff --git a/ntpd/ntpdbase-opts.def b/ntpd/ntpdbase-opts.def index caa352c89..8388334e5 100644 --- a/ntpd/ntpdbase-opts.def +++ b/ntpd/ntpdbase-opts.def @@ -76,33 +76,7 @@ flag = { _EndOfDoc_; }; -flag = { - name = debug-level; - value = d; - max = NOLIMIT; - ifdef = DEBUG; - nopreset; - descrip = "Increase output debug message level"; - omitted-usage = "this package was built using 'configure --disable--debug'"; - doc = <<- _EndOfDoc_ - Increase the debugging message output level. - _EndOfDoc_; -}; - -flag = { - name = set-debug-level; - value = D; - arg-type = string; - max = NOLIMIT; - ifdef = DEBUG; - descrip = "Set the output debug message level"; - omitted-usage = "this package was built using 'configure --disable--debug'"; - flag-code = 'DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );'; - doc = <<- _EndOfDoc_ - Set the output debugging level. Can be supplied multiple times, - but each overrides the previous value(s). - _EndOfDoc_; -}; +#include debug-opt.def flag = { name = driftfile; diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index cc459a5d2..35951841e 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -313,7 +313,7 @@ ntpdcmain( } } - debug = DESC(DEBUG_LEVEL).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; if (HAVE_OPT(INTERACTIVE)) { interactive = 1; diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index c21c8a0d1..4583dccbc 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -459,7 +459,7 @@ ntpqmain( * handled by ntpq_custom_opt_handler(). */ - debug = DESC(DEBUG_LEVEL).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; if (HAVE_OPT(IPV4)) ai_fam_templ = AF_INET; diff --git a/ports/winnt/ntpd/ntservice.c b/ports/winnt/ntpd/ntservice.c index fb6b1c169..f0840bdb9 100644 --- a/ports/winnt/ntpd/ntservice.c +++ b/ports/winnt/ntpd/ntservice.c @@ -109,7 +109,7 @@ int main( || HAVE_OPT(SAVECONFIGQUIT) || HAVE_OPT(HELP) #ifdef DEBUG - || DESC(DEBUG_LEVEL).optOccCt != 0 + || OPT_VALUE_SET_DEBUG_LEVEL != 0 #endif || HAVE_OPT(NOFORK)) foreground = TRUE; diff --git a/sntp/include/debug-opt.def b/sntp/include/debug-opt.def index c11fd753e..516163d6e 100644 --- a/sntp/include/debug-opt.def +++ b/sntp/include/debug-opt.def @@ -12,6 +12,7 @@ flag = { value = d; max = NOLIMIT; nopreset; + flag-code = 'OPT_VALUE_SET_DEBUG_LEVEL++;'; descrip = "Increase debug verbosity level"; doc = <<- _EndOfDoc_ _EndOfDoc_; @@ -22,8 +23,7 @@ flag = { value = D; max = NOLIMIT; descrip = "Set the debug verbosity level"; - arg-type = string; - flag-code = 'DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );'; + arg-type = number; doc = <<- _EndOfDoc_ _EndOfDoc_; }; diff --git a/sntp/main.c b/sntp/main.c index 32d9d79f1..3084b0060 100644 --- a/sntp/main.c +++ b/sntp/main.c @@ -150,7 +150,12 @@ sntp_main ( argv += optct; - debug = DESC(DEBUG_LEVEL).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; + +printf("sntp: DEBUG_LEVEL is %d\n", debug); +// OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt) +printf("sntp: SET_DEBUG_LEVEL is %d\n", OPT_VALUE_SET_DEBUG_LEVEL); +exit(0); TRACE(2, ("init_lib() done, %s%s\n", (ipv4_works) diff --git a/util/ntp-keygen.c b/util/ntp-keygen.c index 0827cff36..b8f09b4e4 100644 --- a/util/ntp-keygen.c +++ b/util/ntp-keygen.c @@ -366,7 +366,7 @@ main( OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); #endif /* OPENSSL */ - debug = DESC( DEBUG_LEVEL ).optOccCt; + debug = OPT_VALUE_SET_DEBUG_LEVEL; if (HAVE_OPT( MD5KEY )) md5key++;