Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern backout previous; (u_int) cast makes checks negativ...



details:   https://anonhg.NetBSD.org/src/rev/de1a0f43bb08
branches:  trunk
changeset: 537608:de1a0f43bb08
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Oct 03 05:18:59 2002 +0000

description:
backout previous; (u_int) cast makes checks negative case too

diffstat:

 sys/kern/kern_resource.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e28f15b7f725 -r de1a0f43bb08 sys/kern/kern_resource.c
--- a/sys/kern/kern_resource.c  Thu Oct 03 04:57:39 2002 +0000
+++ b/sys/kern/kern_resource.c  Thu Oct 03 05:18:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_resource.c,v 1.66 2002/10/03 04:57:39 itojun Exp $        */
+/*     $NetBSD: kern_resource.c,v 1.67 2002/10/03 05:18:59 itojun Exp $        */
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.66 2002/10/03 04:57:39 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.67 2002/10/03 05:18:59 itojun Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -251,7 +251,7 @@
        struct plimit *newplim;
        int error;
 
-       if (which < 0 || (u_int)which >= RLIM_NLIMITS)
+       if ((u_int)which >= RLIM_NLIMITS)
                return (EINVAL);
 
        if (limp->rlim_cur < 0 || limp->rlim_max < 0)
@@ -369,7 +369,7 @@
        } */ *uap = v;
        int which = SCARG(uap, which);
 
-       if (which < 0 || (u_int)which >= RLIM_NLIMITS)
+       if ((u_int)which >= RLIM_NLIMITS)
                return (EINVAL);
        return (copyout(&p->p_rlimit[which], SCARG(uap, rlp),
            sizeof(struct rlimit)));



Home | Main Index | Thread Index | Old Index