summaryrefslogtreecommitdiff
path: root/sys/compat/common
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2009-01-11 20:46:53 +0000
committerchristos <christos@NetBSD.org>2009-01-11 20:46:53 +0000
commit52ef6203ff7d56a4e0b72d383bd4e9feeebd43ad (patch)
treea766f92420bd21ffeeda81dc75fc150d391707b4 /sys/compat/common
parent9ea72e7b8a38390a67b573948f44af94923e94b5 (diff)
*utimes should allow NULL tvp.
Diffstat (limited to 'sys/compat/common')
-rw-r--r--sys/compat/common/vfs_syscalls_50.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/compat/common/vfs_syscalls_50.c b/sys/compat/common/vfs_syscalls_50.c
index 1817f7c714a..15df68d58fd 100644
--- a/sys/compat/common/vfs_syscalls_50.c
+++ b/sys/compat/common/vfs_syscalls_50.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_50.c,v 1.2 2009/01/11 02:45:47 christos Exp $ */
+/* $NetBSD: vfs_syscalls_50.c,v 1.3 2009/01/11 20:46:53 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.2 2009/01/11 02:45:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.3 2009/01/11 20:46:53 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -197,14 +197,18 @@ static int
compat_50_do_sys_utimes(struct lwp *l, struct vnode *vp, const char *path,
int flag, const struct timeval50 *tptr)
{
- struct timeval tv[2];
+ struct timeval tv[2], *tvp;
struct timeval50 tv50[2];
- int error = copyin(tptr, tv50, sizeof(tv50));
- if (error)
- return error;
- timeval50_to_timeval(&tv50[0], &tv[0]);
- timeval50_to_timeval(&tv50[1], &tv[1]);
- return do_sys_utimes(l, vp, path, flag, tv, UIO_SYSSPACE);
+ if (tptr) {
+ int error = copyin(tptr, tv50, sizeof(tv50));
+ if (error)
+ return error;
+ timeval50_to_timeval(&tv50[0], &tv[0]);
+ timeval50_to_timeval(&tv50[1], &tv[1]);
+ tvp = tv;
+ } else
+ tvp = NULL;
+ return do_sys_utimes(l, vp, path, flag, tvp, UIO_SYSSPACE);
}
/*