svn commit: r236918 - head/sys/sys

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Jun 11 20:19:25 UTC 2012


Author: pjd
Date: Mon Jun 11 20:19:24 2012
New Revision: 236918
URL: http://svn.freebsd.org/changeset/base/236918

Log:
  Use consistent way of checking if descriptor number is valid.
  
  MFC after:	1 month

Modified:
  head/sys/sys/filedesc.h

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h	Mon Jun 11 20:17:20 2012	(r236917)
+++ head/sys/sys/filedesc.h	Mon Jun 11 20:19:24 2012	(r236918)
@@ -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 */


More information about the svn-src-all mailing list