-/* $OpenBSD: aux.c,v 1.27 2015/01/16 06:40:09 deraadt Exp $ */
+/* $OpenBSD: aux.c,v 1.28 2015/10/13 08:49:51 guenther Exp $ */
/* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */
/*
*/
#include "rcv.h"
+#include <fcntl.h>
#include "extern.h"
/*
void
alter(char *name)
{
- struct stat sb;
- struct timeval tv[2];
-
- if (stat(name, &sb))
- return;
- (void) gettimeofday(&tv[0], (struct timezone *)0);
- tv[0].tv_sec++;
-#ifdef TIMESPEC_TO_TIMEVAL
- TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec);
-#else
- tv[1].tv_sec = sb.st_mtime;
-#endif
- (void)utimes(name, tv);
+ struct timespec ts[2];
+
+ clock_gettime(CLOCK_REALTIME, &ts[0]);
+ ts[0].tv_sec++;
+ ts[1].tv_nsec = UTIME_OMIT;
+ (void)utimensat(AT_FDCWD, name, ts, 0);
}
/*
-/* $OpenBSD: def.h,v 1.15 2015/01/20 16:59:07 millert Exp $ */
+/* $OpenBSD: def.h,v 1.16 2015/10/13 08:49:51 guenther Exp $ */
/* $NetBSD: def.h,v 1.9 1996/12/28 07:11:00 tls Exp $ */
/*
* SUCH DAMAGE.
*
* @(#)def.h 8.4 (Berkeley) 4/20/95
- * $OpenBSD: def.h,v 1.15 2015/01/20 16:59:07 millert Exp $
+ * $OpenBSD: def.h,v 1.16 2015/10/13 08:49:51 guenther Exp $
*/
/*
#define MAIL_DEF_H
#include <sys/stat.h>
-#include <sys/time.h>
#include <ctype.h>
#include <err.h>