]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
autogen and debug cleanup
authorHarlan Stenn <stenn@ntp.org>
Tue, 18 Jan 2011 12:35:26 +0000 (12:35 +0000)
committerHarlan Stenn <stenn@ntp.org>
Tue, 18 Jan 2011 12:35:26 +0000 (12:35 +0000)
bk: 4d35890e844vND1AkxwDw-k7bfSTwg

sntp/main.c
sntp/main.h

index 8e4a2277f87cba08456c8cf3357d5241b4f4cfb3..7f61a8df2f03eae0d7d04828cf38e6fd7a706e8c 100644 (file)
@@ -103,16 +103,12 @@ sntp_main (
        argc -= optct;
        argv += optct;
 
-#ifdef DEBUG
        debug = DESC(DEBUG_LEVEL).optOccCt;
        DPRINTF(1, ("%s\n", Version));
-#endif
 
-       if (atoint(OPT_ARG(NTPVERSION), &l))
-               ntpver = l;
+       ntpver = OPT_VALUE_NTPVERSION;
 
-       if (atoint(OPT_ARG(STEPLIMIT), &l))
-               steplimit = (double)l / 1000;
+       steplimit = (double) ( OPT_VALUE_STEPLIMIT ) / 1000;
 
        /* Initialize logging system */
        init_logging();
@@ -129,10 +125,7 @@ sntp_main (
        ** - separate bcst and ucst timeouts
        ** - multiple --timeout values in the commandline
        */
-       if (atoint(OPT_ARG(BCTIMEOUT), &l))
-               timeout_tv.tv_sec = l;
-       else 
-               timeout_tv.tv_sec = 68; /* ntpd broadcasts every 64s */
+       timeout_tv.tv_sec = OPT_VALUE_BCTIMEOUT;
        timeout_tv.tv_usec = 0;
 
        /* IPv6 available? */
@@ -182,7 +175,7 @@ sntp_main (
        open_sockets();
 
        if (HAVE_OPT(BROADCAST)) {
-               int             cn = STACKCT_OPT( BROADCAST );
+               int             cn = STACKCT_OPT(  BROADCAST );
                const char **   cp = STACKLST_OPT( BROADCAST );
 
                while (cn-- > 0) {
@@ -779,7 +772,6 @@ offset_calculation (
 
        *root_dispersion = FPTOD(p_rdsp);
 
-#ifdef DEBUG
        if (debug > 2) {
                printf("sntp rootdelay: %f\n", FPTOD(p_rdly));
                printf("sntp rootdisp: %f\n", *root_dispersion);
@@ -799,7 +791,6 @@ offset_calculation (
                printf("sntp offset_calculation: rpkt->xmt:\n");
                l_fp_output(&(rpkt->xmt), stdout);
        }
-#endif
 
        /* Compute offset etc. */
        tmp = p_rec;
index ab41350331d44f2265f09a9d01203fef6bc20ff2..df356f12fdf733d5fc5891eec44af6215044661b 100644 (file)
@@ -4,6 +4,7 @@
 #include <l_stdlib.h>
 #include <ntp_fp.h>
 #include <ntp.h>
+#define DEBUG
 #include <ntp_debug.h>
 #include <ntp_stdlib.h>
 #include <ntp_unixtime.h>