summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-20 21:31:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-20 21:31:58 +0000
commitddce99ae206b9a40347515419cbcadd1136f1c54 (patch)
tree423dcc09aee67b2265fba1d328f9085bd158d393 /sys
parent503147628815fcec50bad05550b4c514ac7913ef (diff)
Move the construction of p_tamenote from sys_open() to doopenat(), so that
it also applies to sys_openat().
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_syscalls.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 4161cd5d275..b5ac7b74bfb 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.221 2015/07/19 02:35:35 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.222 2015/07/20 21:31:57 deraadt Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -812,16 +812,6 @@ sys_open(struct proc *p, void *v, register_t *retval)
syscallarg(int) flags;
syscallarg(mode_t) mode;
} */ *uap = v;
- int flags = SCARG(uap, flags);
-
- switch (flags & O_ACCMODE) {
- case O_WRONLY:
- case O_RDWR:
- p->p_tamenote |= TMN_WRITE;
- break;
- }
- if (flags & O_CREAT)
- p->p_tamenote |= TMN_CREAT;
return (doopenat(p, AT_FDCWD, SCARG(uap, path), SCARG(uap, flags),
SCARG(uap, mode), retval));
@@ -854,6 +844,15 @@ doopenat(struct proc *p, int fd, const char *path, int oflags, mode_t mode,
struct flock lf;
struct nameidata nd;
+ switch (oflags & O_ACCMODE) {
+ case O_WRONLY:
+ case O_RDWR:
+ p->p_tamenote |= TMN_WRITE;
+ break;
+ }
+ if (oflags & O_CREAT)
+ p->p_tamenote |= TMN_CREAT;
+
fdplock(fdp);
if ((error = falloc(p, &fp, &indx)) != 0)