diff -U4 -r glibc-2.10.1/misc/syslog.c glibc-2.10.1+syslog/misc/syslog.c --- glibc-2.10.1/misc/syslog.c 2008-10-22 22:42:26.000000000 +0100 +++ glibc-2.10.1+syslog/misc/syslog.c 2009-06-27 10:24:11.000000000 +0100 @@ -134,8 +134,9 @@ void __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap) { + struct timeval now_tv; struct tm now_tm; time_t now; int fd; FILE *f; @@ -192,15 +193,21 @@ else { __fsetlocking (f, FSETLOCKING_BYCALLER); prioff = fprintf (f, "<%d>", pri); - (void) time (&now); + if (__gettimeofday (&now_tv, (struct timezone *) NULL)) { + now = (time_t) -1; + now_tv.tv_usec = 0; + } else { + now = (time_t) now_tv.tv_sec; + } f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr, f->_IO_write_end - f->_IO_write_ptr, - "%h %e %T ", + "%h %e %T", __localtime_r (&now, &now_tm), _nl_C_locobj_ptr); + fprintf (f, ".%06u ", (unsigned int) now_tv.tv_usec); msgoff = ftell (f); if (LogTag == NULL) LogTag = __progname; if (LogTag != NULL)