/* $NetBSD: compare.c,v 1.11 1996/09/05 09:56:48 mycroft Exp $ */
-/* $OpenBSD: compare.c,v 1.29 2021/10/24 21:24:19 deraadt Exp $ */
+/* $OpenBSD: compare.c,v 1.30 2023/08/11 05:07:28 guenther Exp $ */
/*-
* Copyright (c) 1989, 1993
* Doesn't display microsecond differences.
*/
if (s->flags & F_TIME) {
- struct timeval tv[2];
+ struct timespec ts[2];
- TIMESPEC_TO_TIMEVAL(&tv[0], &s->st_mtimespec);
- TIMESPEC_TO_TIMEVAL(&tv[1], &p->fts_statp->st_mtimespec);
- if (tv[0].tv_sec != tv[1].tv_sec ||
- tv[0].tv_usec != tv[1].tv_usec) {
+ ts[0] = s->st_mtim;
+ ts[1] = p->fts_statp->st_mtim;
+ if (ts[0].tv_sec != ts[1].tv_sec ||
+ ts[0].tv_nsec != ts[1].tv_nsec) {
LABEL;
(void)printf("%smodification time (%.24s, ",
- tab, ctime(&s->st_mtimespec.tv_sec));
- (void)printf("%.24s",
- ctime(&p->fts_statp->st_mtimespec.tv_sec));
+ tab, ctime(&s->st_mtime));
+ (void)printf("%.24s", ctime(&p->fts_statp->st_mtime));
if (tflag) {
- tv[1] = tv[0];
- if (utimes(p->fts_accpath, tv))
+ ts[1] = ts[0];
+ if (utimensat(AT_FDCWD, p->fts_accpath, ts, 0))
(void)printf(", not modified: %s)\n",
strerror(errno));
else
/* $NetBSD: create.c,v 1.11 1996/09/05 09:24:19 mycroft Exp $ */
-/* $OpenBSD: create.c,v 1.35 2021/10/24 21:24:19 deraadt Exp $ */
+/* $OpenBSD: create.c,v 1.36 2023/08/11 05:07:28 guenther Exp $ */
/*-
* Copyright (c) 1989, 1993
(long long)p->fts_statp->st_size);
if (keys & F_TIME)
output(indent, &offset, "time=%lld.%ld",
- (long long)p->fts_statp->st_mtimespec.tv_sec,
- p->fts_statp->st_mtimespec.tv_nsec);
+ (long long)p->fts_statp->st_mtim.tv_sec,
+ p->fts_statp->st_mtim.tv_nsec);
if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
if ((fd = open(p->fts_accpath, MTREE_O_FLAGS)) == -1 ||
crc(fd, &val, &len))
-/* $OpenBSD: mtree.h,v 1.13 2012/07/08 21:19:42 naddy Exp $ */
+/* $OpenBSD: mtree.h,v 1.14 2023/08/11 05:07:28 guenther Exp $ */
/* $NetBSD: mtree.h,v 1.7 1995/03/07 21:26:27 cgd Exp $ */
/*-
struct _node *parent, *child; /* up, down */
struct _node *prev, *next; /* left, right */
off_t st_size; /* size */
- struct timespec st_mtimespec; /* last modification time */
+ struct timespec st_mtim; /* last modification time */
u_int32_t cksum; /* check sum */
char *md5digest; /* MD5 digest */
char *rmd160digest; /* RIPEMD-160 digest */
/* $NetBSD: spec.c,v 1.6 1995/03/07 21:12:12 cgd Exp $ */
-/* $OpenBSD: spec.c,v 1.29 2018/09/16 02:41:16 millert Exp $ */
+/* $OpenBSD: spec.c,v 1.30 2023/08/11 05:07:28 guenther Exp $ */
/*-
* Copyright (c) 1989, 1993
}
break;
case F_TIME:
- ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
+ ip->st_mtim.tv_sec = strtoull(val, &ep, 10);
if (*ep != '.')
error("invalid time %s", val);
val = ep + 1;
- ip->st_mtimespec.tv_nsec = strtoul(val, &ep, 10);
+ ip->st_mtim.tv_nsec = strtoul(val, &ep, 10);
if (*ep)
error("invalid time %s", val);
break;