diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1998-09-24 18:49:32 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1998-09-24 18:49:32 +0000 |
commit | 107cbee34c3705f9b06917a7f4c81c40d7c557d3 (patch) | |
tree | 425d77353f6753d5c104e560ca94d8df0984a8f6 | |
parent | 89d745071b44c9ae209bf7a6dd820a525e3baad7 (diff) |
pretty up previous fix
-rw-r--r-- | sys/kern/kern_exec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 6de7744cdf9..e40f79bcb84 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.24 1998/09/23 22:48:08 art Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.25 1998/09/24 18:49:31 art Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -489,19 +489,21 @@ sys_execve(p, v, retval) struct nameidata nd; struct file *fp; int indx; + short flags; + + flags = FREAD | (i == 0 ? 0 : FWRITE); if (p->p_fd->fd_ofiles[i] == NULL) { if ((error = falloc(p, &fp, &indx)) != 0) continue; NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/null", p); - if ((error = vn_open(&nd, FREAD | - (i == 0 ? 0 : FWRITE), 0)) != 0) { + if ((error = vn_open(&nd, flags, 0)) != 0) { ffree(fp); p->p_fd->fd_ofiles[indx] = NULL; break; } - fp->f_flag = FREAD | (i == 0 ? 0 : FWRITE); + fp->f_flag = flags; fp->f_type = DTYPE_VNODE; fp->f_ops = &vnops; fp->f_data = (caddr_t)nd.ni_vp; |