=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/newsyslog/newsyslog.c,v retrieving revision 1.101 retrieving revision 1.102 diff -c -r1.101 -r1.102 *** src/usr.bin/newsyslog/newsyslog.c 2016/06/01 16:57:48 1.101 --- src/usr.bin/newsyslog/newsyslog.c 2017/03/16 10:32:01 1.102 *************** *** 1,4 **** ! /* $OpenBSD: newsyslog.c,v 1.101 2016/06/01 16:57:48 tedu Exp $ */ /* * Copyright (c) 1999, 2002, 2003 Todd C. Miller --- 1,4 ---- ! /* $OpenBSD: newsyslog.c,v 1.102 2017/03/16 10:32:01 bluhm Exp $ */ /* * Copyright (c) 1999, 2002, 2003 Todd C. Miller *************** *** 142,148 **** char *conf = CONF; /* Configuration file to use */ time_t timenow; char hostname[HOST_NAME_MAX+1]; /* Hostname */ ! char *daytime; /* timenow in human readable form */ char *arcdir; /* Dir to put archives in (if it exists) */ FILE *openmail(void); --- 142,148 ---- char *conf = CONF; /* Configuration file to use */ time_t timenow; char hostname[HOST_NAME_MAX+1]; /* Hostname */ ! char daytime[33]; /* timenow in human readable form */ char *arcdir; /* Dir to put archives in (if it exists) */ FILE *openmail(void); *************** *** 402,413 **** void parse_args(int argc, char **argv) { char *p; int ch; ! timenow = time(NULL); ! daytime = ctime(&timenow) + 4; ! daytime[15] = '\0'; /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname)); --- 402,419 ---- void parse_args(int argc, char **argv) { + struct timeval now; + struct tm *tm; + size_t l; char *p; int ch; ! gettimeofday(&now, NULL); ! timenow = now.tv_sec; ! tm = gmtime(&now.tv_sec); ! l = strftime(daytime, sizeof(daytime), "%FT%T", tm); ! snprintf(daytime + l, sizeof(daytime) - l, ".%03ldZ", ! now.tv_usec / 1000); /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname));