summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-08 22:28:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-08 22:28:57 +0000
commit8e47430ea924f80fea503915943e771c328eb7eb (patch)
treee5871038047fe7ed03de09e6a220e4e73c49ff2c /sys/kern
parente94ffaf418747e568db195c0d8d1046cac1262ff (diff)
open fd1 and fd2 as FREAD|FWRITE
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 559d8b43caf..2dce4a021f4 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.21 1998/07/02 09:03:42 deraadt Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.22 1998/07/08 22:28:56 deraadt Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -495,7 +495,8 @@ sys_execve(p, v, retval)
continue;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE,
"/dev/null", p);
- if ((error = vn_open(&nd, FREAD, 0)) != 0) {
+ if ((error = vn_open(&nd, FREAD |
+ (i == 0 ? 0 : FWRITE), 0)) != 0) {
ffree(fp);
p->p_fd->fd_ofiles[indx] = NULL;
break;