Module Name: src
Committed By: enami
Date: Mon Aug 22 22:09:07 UTC 2011
Modified Files:
src/sys/kern: vfs_syscalls.c
Log Message:
When both nanoseconds fields of futimens/utimensat call are set
to UTIMES_NOW, act as if NULL is passed to second argument, i.e.,
do same permission check and set exactly same value to both access
and modification time.
To generate a diff of this commit:
cvs rdiff -u -r1.437 -r1.438 src/sys/kern/vfs_syscalls.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.437 src/sys/kern/vfs_syscalls.c:1.438
--- src/sys/kern/vfs_syscalls.c:1.437 Thu Aug 18 19:34:47 2011
+++ src/sys/kern/vfs_syscalls.c Mon Aug 22 22:09:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls.c,v 1.437 2011/08/18 19:34:47 manu Exp $ */
+/* $NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.437 2011/08/18 19:34:47 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $");
#ifdef _KERNEL_OPT
#include "opt_fileassoc.h"
@@ -3137,10 +3137,13 @@
}
}
- if (ts[0].tv_nsec == UTIME_NOW)
+ if (ts[0].tv_nsec == UTIME_NOW) {
nanotime(&ts[0]);
-
- if (ts[1].tv_nsec == UTIME_NOW)
+ if (ts[1].tv_nsec == UTIME_NOW) {
+ vanull = true;
+ ts[1] = ts[0];
+ }
+ } else if (ts[1].tv_nsec == UTIME_NOW)
nanotime(&ts[1]);
if (vp == NULL) {