diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-25 19:44:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-25 19:44:51 +0000 |
commit | 62e9c856dfc107cea0c58382483ea0fee3b139e5 (patch) | |
tree | b4ffbb5bbb9044344cbd80be0abff5505cc8375c /sys/kern | |
parent | 430fe69f326680c683be8cc140b83f55afe620bf (diff) |
for *utimes(), deal with tv_sec == VNOVAL; problem noted by syssgm@dtir.qld.gov.au
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index c60269861bc..cbb7e0136dd 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.38 1998/02/16 21:56:29 millert Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.39 1998/03/25 19:44:50 deraadt Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -1810,6 +1810,11 @@ sys_utimes(p, v, retval) sizeof (tv)); if (error) return (error); + /* XXX workaround timeval matching the VFS constant VNOVAL */ + if (tv[0].tv_sec == VNOVAL) + tv[0].tv_sec = VNOVAL - 1; + if (tv[1].tv_sec == VNOVAL) + tv[1].tv_sec = VNOVAL - 1; } NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); if ((error = namei(&nd)) != 0) @@ -1861,6 +1866,11 @@ sys_futimes(p, v, retval) sizeof (tv)); if (error) return (error); + /* XXX workaround timeval matching the VFS constant VNOVAL */ + if (tv[0].tv_sec == VNOVAL) + tv[0].tv_sec = VNOVAL - 1; + if (tv[1].tv_sec == VNOVAL) + tv[1].tv_sec = VNOVAL - 1; } if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); |