Source-Changes-HG archive

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

[src/trunk]: src/sys/kern chgsbsize: correct limit check and ui_sbsize calcul...



details:   https://anonhg.NetBSD.org/src/rev/1ee2e6c8023b
branches:  trunk
changeset: 565895:1ee2e6c8023b
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Apr 23 02:13:29 2004 +0000

description:
chgsbsize: correct limit check and ui_sbsize calculation.
ok'ed by Christos Zoulas.

diffstat:

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

diffs (29 lines):

diff -r 3f3ae2df07ae -r 1ee2e6c8023b sys/kern/kern_resource.c
--- a/sys/kern/kern_resource.c  Thu Apr 22 23:02:39 2004 +0000
+++ b/sys/kern/kern_resource.c  Fri Apr 23 02:13:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_resource.c,v 1.79 2004/04/17 15:15:29 christos Exp $      */
+/*     $NetBSD: kern_resource.c,v 1.80 2004/04/23 02:13:29 yamt Exp $  */
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.79 2004/04/17 15:15:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.80 2004/04/23 02:13:29 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -952,8 +952,8 @@
 
        if ((uip = getuidinfo(uid)) == NULL)
                uip = allocuidinfo(uid);
-       nsb = uip->ui_sbsize + to + *hiwat;
-       if (nsb > *hiwat && nsb > max)
+       nsb = uip->ui_sbsize + to - *hiwat;
+       if (to > *hiwat && nsb > max)
                goto done;
        *hiwat = to;
        uip->ui_sbsize = nsb;



Home | Main Index | Thread Index | Old Index