summaryrefslogtreecommitdiffstats
path: root/sys/svr4
diff options
context:
space:
mode:
authornewton <newton@FreeBSD.org>1999-12-12 10:27:04 +0000
committernewton <newton@FreeBSD.org>1999-12-12 10:27:04 +0000
commit2fa1d32877711ee812844a7181e59d10427bcd6a (patch)
treeeffe8f00d652baf7de99a2d4ce5ba673bf610498 /sys/svr4
parent87823f200f59e738821f3a238834fff4117ce9d5 (diff)
downloadFreeBSD-src-2fa1d32877711ee812844a7181e59d10427bcd6a.zip
FreeBSD-src-2fa1d32877711ee812844a7181e59d10427bcd6a.tar.gz
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>
Diffstat (limited to 'sys/svr4')
-rw-r--r--sys/svr4/svr4_fcntl.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/svr4/svr4_fcntl.c b/sys/svr4/svr4_fcntl.c
index a0b4e39..abff2da 100644
--- a/sys/svr4/svr4_fcntl.c
+++ b/sys/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;
OpenPOWER on IntegriCloud