From: Harlan Stenn Date: Mon, 10 Jan 2011 23:45:26 +0000 (+0000) Subject: debug level cleanup X-Git-Tag: NTP_4_2_7P131~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=784f7f582a7ba8c737b12dd2ee618b96ea0c85e2;p=thirdparty%2Fntp.git debug level cleanup bk: 4d2b9a16DL9_K9D_am83s-pPMjcSLg --- diff --git a/sntp/main.c b/sntp/main.c index 517e465b8..058621fc7 100644 --- a/sntp/main.c +++ b/sntp/main.c @@ -485,7 +485,7 @@ ntp_cb( int rpktl; int rc; - if (debug) + if (debug > 1) printf("ntp_cb: event on socket %d:%s%s%s%s [%s%s] <%s>\n", (int) fd, (what & EV_TIMEOUT) ? " timeout" : "", @@ -501,7 +501,7 @@ ntp_cb( rpktl = recvpkt(fd, &r_pkt, sizeof rbuf, (nctx->dctx->flags & CTX_UCST) ? &(nctx->x_pkt) : 0); - DPRINTF(1, ("ntp_cb: recvpkt returned %x", rpktl)); + DPRINTF(2, ("ntp_cb: recvpkt returned %x/n", rpktl)); /* If this is a Unicast packet, we're done ... */ if (nctx->dctx->flags & CTX_UCST) { @@ -730,9 +730,7 @@ offset_calculation ( *offset = (t21 + t34) / 2.; delta = t21 - t34; - if (debug) - printf("sntp offset_calculation:\tt21: %.6f\t\t t34: %.6f\n\t\tdelta: %.6f\t offset: %.6f\n", - t21, t34, delta, *offset); + DPRINTF(2, ("sntp offset_calculation:\tt21: %.6f\t\t t34: %.6f\n\t\tdelta: %.6f\t offset: %.6f\n", t21, t34, delta, *offset)); } diff --git a/sntp/networking.c b/sntp/networking.c index f58b0633f..15cea6763 100644 --- a/sntp/networking.c +++ b/sntp/networking.c @@ -115,10 +115,7 @@ sendpkt ( /* oh well */ } } else { -#ifdef DEBUG - if (debug) - printf("Packet sent.\n"); -#endif + DPRINTF(3, ("Packet sent.\n")); } }