From bb720fc6212143ac3251ca75aa59c56a9a7c0554 Mon Sep 17 00:00:00 2001 From: provos Date: Tue, 13 Jul 1999 15:17:50 +0000 Subject: introduce fdremove() to mark a file descriptor as unused. fdremove makes sure that the fd_freefile hints stay in sync, otherwise free file descriptors might not be overlooked by fdalloc(); ok millert@ --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_exec.c') diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f3d019fec0d..352efbb5321 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.29 1999/06/23 09:44:28 art Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.30 1999/07/13 15:17:50 provos Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -517,7 +517,7 @@ sys_execve(p, v, retval) "/dev/null", p); if ((error = vn_open(&nd, flags, 0)) != 0) { ffree(fp); - p->p_fd->fd_ofiles[indx] = NULL; + fdremove(p->p_fd, indx); break; } fp->f_flag = flags; -- cgit v1.2.3-59-g8ed1b