diff options
author | 2002-02-08 13:53:27 +0000 | |
---|---|---|
committer | 2002-02-08 13:53:27 +0000 | |
commit | 43c6a78befebd24f220c7d68787d20a6f035d4fe (patch) | |
tree | 04d50079db715a2bbe95431b803233d4950c68c1 /sys/kern/kern_exec.c | |
parent | There are NFS servers where it's possible to modify a symbolic link. Remove aggressive optimization (diff) | |
download | wireguard-openbsd-43c6a78befebd24f220c7d68787d20a6f035d4fe.tar.xz wireguard-openbsd-43c6a78befebd24f220c7d68787d20a6f035d4fe.zip |
- Rename FILE_{,UN}USE to FREF and FRELE. USE is a bad verb and we don't have
the same semantics as NetBSD anyway, so it's good to avoid name collissions.
- Always fdremove before freeing the file, not the other way around.
- falloc FREFs the file.
- have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to
falloc FREFing the file).
- Use closef as much as possible instead of ffree in error paths of
falloc:ing functions. closef is much more careful with the fd and can
deal with the fd being forcibly closed by dup2. Also try to avoid
manually calling *fo_close when closef can do that for us (this makes
some error paths mroe complicated (sys_socketpair and sys_pipe), but
others become simpler (sys_open)).
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index b8b6b6d479a..2cc8429b7d3 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.63 2002/01/20 11:27:52 art Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.64 2002/02/08 13:53:28 art Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -550,13 +550,13 @@ sys_execve(p, v, retval) panic("sys_execve: falloc indx != i"); #endif if ((error = cdevvp(getnulldev(), &vp)) != 0) { - ffree(fp); fdremove(p->p_fd, indx); + closef(fp, p); break; } if ((error = VOP_OPEN(vp, flags, p->p_ucred, p)) != 0) { - ffree(fp); fdremove(p->p_fd, indx); + closef(fp, p); vrele(vp); break; } |