Skip to content

Commit f0a8c5e

Browse files
More consistent debug messages
1 parent 4ff9236 commit f0a8c5e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

hc_ntp.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,12 @@ static void hc_ntp_request (const ntpHeaderV3 *head,
335335
hc_broadcast_reply ((char *)&ntpResponse, sizeof(ntpResponse), source);
336336

337337
if (hc_debug_enabled())
338-
printf ("Response to %s: origin=%u/%08x, reference=%u/%08x, "
339-
"receive=%u/%08x, transmit=%u/%08x dispersion=%dms\n",
338+
printf ("Response to %s at %d.%0.03d: "
339+
"origin=%u/%08x, reference=%u/%08x, "
340+
"receive=%u/%08x, transmit=%u/%08x dispersion=%dms\n",
340341
hc_broadcast_format (source),
342+
(long)(transmit.tv_sec),
343+
(int)(transmit.tv_usec / 1000),
341344
ntohl(ntpResponse.origin.seconds),
342345
ntohl(ntpResponse.origin.fraction),
343346
ntohl(ntpResponse.reference.seconds),
@@ -420,10 +423,12 @@ void hc_ntp_periodic (const struct timeval *wakeup) {
420423
hc_ntp_status_db->live.broadcast += 1;
421424

422425
if (hc_debug_enabled())
423-
printf ("Sent broadcast packet at %ld.%03.3d "
424-
"(dispersion=%dms)\n",
426+
printf ("Sent broadcast packet at %ld.%03.3d: "
427+
"transmit=%u/%08x, dispersion=%dms\n",
425428
(long)(timestamp.tv_sec),
426429
(int)(timestamp.tv_usec / 1000),
430+
ntohl(ntpBroadcast.transmit.seconds),
431+
ntohl(ntpBroadcast.transmit.fraction),
427432
dispersion);
428433
}
429434
hc_ntp_status_db->mode = 'S';

0 commit comments

Comments
 (0)