Wed Jul 1 22:47:12 2009 UTC ()
Pull up following revision(s) (requested by rmind in ticket #841):
	sys/kern/vfs_syscalls.c: revision 1.392
do_sys_utimes: fix a bug introduced by rev.1.367.
VA_UTIMES_NULL is in va_vaflags, not va_flags.


(snj)
diff -r1.376.4.2 -r1.376.4.2.2.1 src/sys/kern/vfs_syscalls.c

cvs diff -r1.376.4.2 -r1.376.4.2.2.1 src/sys/kern/vfs_syscalls.c (expand / switch to unified diff)

--- src/sys/kern/vfs_syscalls.c 2009/02/16 03:33:17 1.376.4.2
+++ src/sys/kern/vfs_syscalls.c 2009/07/01 22:47:12 1.376.4.2.2.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_syscalls.c,v 1.376.4.2 2009/02/16 03:33:17 snj Exp $ */ 1/* $NetBSD: vfs_syscalls.c,v 1.376.4.2.2.1 2009/07/01 22:47:12 snj Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -53,27 +53,27 @@ @@ -53,27 +53,27 @@
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 53 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * SUCH DAMAGE. 60 * SUCH DAMAGE.
61 * 61 *
62 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95 62 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95
63 */ 63 */
64 64
65#include <sys/cdefs.h> 65#include <sys/cdefs.h>
66__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.376.4.2 2009/02/16 03:33:17 snj Exp $"); 66__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.376.4.2.2.1 2009/07/01 22:47:12 snj Exp $");
67 67
68#include "opt_compat_netbsd.h" 68#include "opt_compat_netbsd.h"
69#include "opt_compat_43.h" 69#include "opt_compat_43.h"
70#include "opt_fileassoc.h" 70#include "opt_fileassoc.h"
71#include "veriexec.h" 71#include "veriexec.h"
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75#include <sys/namei.h> 75#include <sys/namei.h>
76#include <sys/filedesc.h> 76#include <sys/filedesc.h>
77#include <sys/kernel.h> 77#include <sys/kernel.h>
78#include <sys/file.h> 78#include <sys/file.h>
79#include <sys/stat.h> 79#include <sys/stat.h>
@@ -3041,27 +3041,27 @@ do_sys_utimes(struct lwp *l, struct vnod @@ -3041,27 +3041,27 @@ do_sys_utimes(struct lwp *l, struct vnod
3041 vp = nd.ni_vp; 3041 vp = nd.ni_vp;
3042 } else 3042 } else
3043 nd.ni_vp = NULL; 3043 nd.ni_vp = NULL;
3044 3044
3045 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); 3045 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
3046 setbirthtime = (VOP_GETATTR(vp, &vattr, l->l_cred) == 0 && 3046 setbirthtime = (VOP_GETATTR(vp, &vattr, l->l_cred) == 0 &&
3047 timespeccmp(&ts[1], &vattr.va_birthtime, <)); 3047 timespeccmp(&ts[1], &vattr.va_birthtime, <));
3048 VATTR_NULL(&vattr); 3048 VATTR_NULL(&vattr);
3049 vattr.va_atime = ts[0]; 3049 vattr.va_atime = ts[0];
3050 vattr.va_mtime = ts[1]; 3050 vattr.va_mtime = ts[1];
3051 if (setbirthtime) 3051 if (setbirthtime)
3052 vattr.va_birthtime = ts[1]; 3052 vattr.va_birthtime = ts[1];
3053 if (vanull) 3053 if (vanull)
3054 vattr.va_flags |= VA_UTIMES_NULL; 3054 vattr.va_vaflags |= VA_UTIMES_NULL;
3055 error = VOP_SETATTR(vp, &vattr, l->l_cred); 3055 error = VOP_SETATTR(vp, &vattr, l->l_cred);
3056 VOP_UNLOCK(vp, 0); 3056 VOP_UNLOCK(vp, 0);
3057 3057
3058 if (nd.ni_vp != NULL) 3058 if (nd.ni_vp != NULL)
3059 vrele(nd.ni_vp); 3059 vrele(nd.ni_vp);
3060 3060
3061 return error; 3061 return error;
3062} 3062}
3063 3063
3064/* 3064/*
3065 * Truncate a file given its path name. 3065 * Truncate a file given its path name.
3066 */ 3066 */
3067/* ARGSUSED */ 3067/* ARGSUSED */