X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/5976eb9983e5f88f22d55f26ddac53c23aeb7f3d..d5b80e59458182b2d557a929a18cb8c70cd56b68:/src/src/debug.c diff --git a/src/src/debug.c b/src/src/debug.c index 8c414d0f9..09e03f1e4 100644 --- a/src/src/debug.c +++ b/src/src/debug.c @@ -182,10 +182,16 @@ if (debug_ptr == debug_buffer) { DEBUG(D_timestamp) { - time_t now = time(NULL); - struct tm *t = timestamps_utc? gmtime(&now) : localtime(&now); - debug_ptr += sprintf(CS debug_ptr, "%02d:%02d:%02d ", t->tm_hour, t->tm_min, - t->tm_sec); + struct timeval now; + time_t tmp; + struct tm * t; + + gettimeofday(&now, NULL); + tmp = now.tv_sec; + t = timestamps_utc ? gmtime(&tmp) : localtime(&tmp); + debug_ptr += sprintf(CS debug_ptr, + LOGGING(millisec) ? "%02d:%02d:%02d.%03d " : "%02d:%02d:%02d ", + t->tm_hour, t->tm_min, t->tm_sec, (int)(now.tv_usec/1000)); } DEBUG(D_pid)