Date: Sun, 17 Apr 2016 20:00:25 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298157 - head/usr.bin/mail Message-ID: <201604172000.u3HK0PTO048322@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sun Apr 17 20:00:24 2016 New Revision: 298157 URL: https://svnweb.freebsd.org/changeset/base/298157 Log: mail: Don't truncate mtime of mailbox to microseconds. Modified: head/usr.bin/mail/util.c Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Sun Apr 17 18:25:34 2016 (r298156) +++ head/usr.bin/mail/util.c Sun Apr 17 20:00:24 2016 (r298157) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> +#include <fcntl.h> + #include "rcv.h" #include "extern.h" @@ -319,15 +321,13 @@ unstack(void) void alter(char *name) { - struct stat sb; - struct timeval tv[2]; + struct timespec ts[2]; - if (stat(name, &sb)) - return; - (void)gettimeofday(&tv[0], NULL); - tv[0].tv_sec++; - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); - (void)utimes(name, tv); + (void)clock_gettime(CLOCK_REALTIME, &ts[0]); + ts[0].tv_sec++; + ts[1].tv_sec = 0; + ts[1].tv_nsec = UTIME_OMIT; + (void)utimensat(AT_FDCWD, name, ts, 0); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604172000.u3HK0PTO048322>