Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern When both nanoseconds fields of futimens/utimensat ...



details:   https://anonhg.NetBSD.org/src/rev/8e9eb9ba41fd
branches:  trunk
changeset: 768612:8e9eb9ba41fd
user:      enami <enami%NetBSD.org@localhost>
date:      Mon Aug 22 22:09:07 2011 +0000

description:
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.

diffstat:

 sys/kern/vfs_syscalls.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 75766c110ea4 -r 8e9eb9ba41fd sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Mon Aug 22 21:59:09 2011 +0000
+++ b/sys/kern/vfs_syscalls.c   Mon Aug 22 22:09:07 2011 +0000
@@ -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) {



Home | Main Index | Thread Index | Old Index