Source-Changes-HG archive

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

[src/netbsd-3-0]: src/sys/kern Pull up following revision(s) (requested by mr...



details:   https://anonhg.NetBSD.org/src/rev/4023dba9fd8f
branches:  netbsd-3-0
changeset: 579522:4023dba9fd8f
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Mar 27 10:43:35 2009 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1999):
        sys/kern/init_sysctl.c: revision 1.158
always calculate "needed" for KERN_FILE2 calls.  this allows a caller
to get an estimate of the needed space, like the intention is.

diffstat:

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

diffs (38 lines):

diff -r 429463f05c3d -r 4023dba9fd8f sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c    Thu Feb 26 08:22:26 2009 +0000
+++ b/sys/kern/init_sysctl.c    Fri Mar 27 10:43:35 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_sysctl.c,v 1.36.2.6 2005/09/08 21:06:30 tron Exp $ */
+/*     $NetBSD: init_sysctl.c,v 1.36.2.6.2.1 2009/03/27 10:43:35 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.36.2.6 2005/09/08 21:06:30 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.36.2.6.2.1 2009/03/27 10:43:35 msaitoh Exp $");
 
 #include "opt_sysv.h"
 #include "opt_multiprocessor.h"
@@ -1947,8 +1947,8 @@
                                dp += elem_size;
                                len -= elem_size;
                        }
+                       needed += elem_size;
                        if (elem_count > 0) {
-                               needed += elem_size;
                                if (elem_count != INT_MAX)
                                        elem_count--;
                        }
@@ -1981,8 +1981,8 @@
                                        dp += elem_size;
                                        len -= elem_size;
                                }
+                               needed += elem_size;
                                if (elem_count > 0) {
-                                       needed += elem_size;
                                        if (elem_count != INT_MAX)
                                                elem_count--;
                                }



Home | Main Index | Thread Index | Old Index