summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>1998-09-23 22:48:08 +0000
committerart <art@openbsd.org>1998-09-23 22:48:08 +0000
commit63977b5d3d8fedfb482f4db0745059714ffb7cc6 (patch)
treeaff497f7c0d096a089cd799b0fcf7d45c130d185 /sys/kern/kern_exec.c
parentdetect xfs when it's there (diff)
downloadwireguard-openbsd-63977b5d3d8fedfb482f4db0745059714ffb7cc6.tar.xz
wireguard-openbsd-63977b5d3d8fedfb482f4db0745059714ffb7cc6.zip
use the same flags for f_flag as there were used for vn_open, otherwise vn_close will not decrease v_writecount for the vnode causing panics
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 58a4780ccd0..6de7744cdf9 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.23 1998/07/28 00:13:05 millert Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.24 1998/09/23 22:48:08 art Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -501,7 +501,7 @@ sys_execve(p, v, retval)
p->p_fd->fd_ofiles[indx] = NULL;
break;
}
- fp->f_flag = FREAD;
+ fp->f_flag = FREAD | (i == 0 ? 0 : FWRITE);
fp->f_type = DTYPE_VNODE;
fp->f_ops = &vnops;
fp->f_data = (caddr_t)nd.ni_vp;