aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorMark Newton <newton@FreeBSD.org>1999-12-12 10:27:04 +0000
committerMark Newton <newton@FreeBSD.org>1999-12-12 10:27:04 +0000
commitce12799bad863bc7d71cf4f26d359c120ee5d7fa (patch)
treefde90acad002b9db9709917ac9d75b0ec02ac0b7 /sys/compat/svr4
parentc137e096c291f3adcd14da01a9ec9652e005c4b8 (diff)
downloadsrc-ce12799bad863bc7d71cf4f26d359c120ee5d7fa.tar.gz
src-ce12799bad863bc7d71cf4f26d359c120ee5d7fa.zip
fd_revoke() shouldn't panic if the descriptor provided is not a file or
socket. Return EINVAL instead. Submitted by: Ville-Pertti Keinone <will@iki.fi>
Notes
Notes: svn path=/head/; revision=54492
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_fcntl.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c
index a0b4e397682f..abff2da2c5b8 100644
--- a/sys/compat/svr4/svr4_fcntl.c
+++ b/sys/compat/svr4/svr4_fcntl.c
@@ -256,17 +256,10 @@ fd_revoke(p, fd)
if ((u_int)fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL)
return EBADF;
- switch (fp->f_type) {
- case DTYPE_VNODE:
- vp = (struct vnode *) fp->f_data;
-
- case DTYPE_SOCKET:
+ if (fp->f_type != DTYPE_VNODE)
return EINVAL;
- default:
- panic("svr4_fcntl(F_REVOKE)");
- /*NOTREACHED*/
- }
+ vp = (struct vnode *) fp->f_data;
if (vp->v_type != VCHR && vp->v_type != VBLK) {
error = EINVAL;