summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mail/util.c')
-rw-r--r--usr.bin/mail/util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c
index b869fb0..43a0a55 100644
--- a/usr.bin/mail/util.c
+++ b/usr.bin/mail/util.c
@@ -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];
-
- 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);
+ struct timespec ts[2];
+
+ (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);
}
/*
OpenPOWER on IntegriCloud