diff options
author | alfred <alfred@FreeBSD.org> | 2002-01-23 08:40:35 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-01-23 08:40:35 +0000 |
commit | 53eeef7678d4eb2327aa3aa6f05b464964b83aaf (patch) | |
tree | a1ea6edbf761cc293162dcc334e200a010f0f17e | |
parent | e44d80bb31a533d46723ee20c1f100bb87d0233f (diff) | |
download | FreeBSD-src-53eeef7678d4eb2327aa3aa6f05b464964b83aaf.zip FreeBSD-src-53eeef7678d4eb2327aa3aa6f05b464964b83aaf.tar.gz |
in fget() return EINVAL when the descriptor requested is negative.
-rw-r--r-- | sys/kern/kern_descrip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index db41fbd..fe73aef 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1496,7 +1496,7 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, int hold) (fp = fdp->fd_ofiles[fd]) == NULL || fp->f_ops == &badfileops) { FILEDESC_UNLOCK(fdp); - return(EBADF); + return(fd < 0 ? EINVAL : EBADF); } /* |