...over gettimeofday()+TIMEVAL_TO_TIMESPEC()
Note that smtpd already uses clock_gettime() so this isn't an issue for
-portable.
ok?
Index: smtpd/queue_fs.c
===================================================================
RCS file: /data/src/openbsd/src/usr.sbin/smtpd/queue_fs.c,v
retrieving revision 1.14
diff -u -p -r1.14 queue_fs.c
--- smtpd/queue_fs.c 30 Dec 2015 11:40:30 -0000 1.14
+++ smtpd/queue_fs.c 4 Feb 2017 08:45:46 -0000
@@ -729,7 +729,6 @@ queue_fs_init(struct passwd *pw, int ser
char *paths[] = { PATH_QUEUE, PATH_CORRUPT, PATH_INCOMING };
char path[PATH_MAX];
int ret;
- struct timeval tv;
/* remove incoming/ if it exists */
if (server)
@@ -746,9 +745,8 @@ queue_fs_init(struct passwd *pw, int ser
ret = 0;
}
- if (gettimeofday(&tv, NULL) == -1)
- err(1, "gettimeofday");
- TIMEVAL_TO_TIMESPEC(&tv, &startup);
+ if (clock_gettime(CLOCK_REALTIME, &startup))
+ err(1, "clock_gettime");
tree_init(&evpcount);