Author: mjg
Date: Tue Aug 30 21:48:10 2016
New Revision: 305091
URL: https://svnweb.freebsd.org/changeset/base/305091

Log:
  fd: simplify fd testing in fget_locked by casting to u_int

Modified:
  head/sys/sys/filedesc.h

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h     Tue Aug 30 21:43:57 2016        (r305090)
+++ head/sys/sys/filedesc.h     Tue Aug 30 21:48:10 2016        (r305091)
@@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd
 
        FILEDESC_LOCK_ASSERT(fdp);
 
-       if (fd < 0 || fd > fdp->fd_lastfile)
+       if ((u_int)fd > fdp->fd_lastfile)
                return (NULL);
 
        return (fdp->fd_ofiles[fd].fde_file);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to