From cc367c4a7e600504bab9e44ab9af69911fc1e743 Mon Sep 17 00:00:00 2001 From: pjd Date: Mon, 11 Jun 2012 20:19:24 +0000 Subject: [PATCH] Use consistent way of checking if descriptor number is valid. MFC after: 1 month --- sys/sys/filedesc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 1b87bab201d8..f32165a7fa8b 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -141,7 +141,7 @@ static __inline struct file * fget_locked(struct filedesc *fdp, int fd) { - return (fd < 0 || fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]); + return ((unsigned int)fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]); } #endif /* _KERNEL */