Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.4.19 /kernel/sysctl.c

Filename:/kernel/sysctl.c
Lines Added:7
Lines Deleted:7
Also changed in: (Previous) 2.4.19-rc5-ac1  2.4.19-rc5  2.4.19-rc4  2.4.19-rc3-ac5  2.4.19-rc3-ac4  2.4.19-rc3-ac3 
(Following) 2.4.19-ac1  2.4.19-ac2  2.4.19-ac3  2.4.19-ac4  2.4.20-pre1-ac1  2.4.20-pre1-ac2 

Location
[  2.4.19
  [  kernel
     o  sysctl.c

Patch

diff -urN linux-2.4.18/kernel/sysctl.c linux-2.4.19/kernel/sysctl.c
--- linux-2.4.18/kernel/sysctl.c   Fri Dec 21 09:42:04 2001
+++ linux-2.4.19/kernel/sysctl.c   Fri Aug  2 17:39:46 2002
@@ -275,6 +275,8 @@
    &vm_min_readahead,sizeof(int), 0644, NULL, &proc_dointvec},
    {VM_MAX_READAHEAD, "max-readahead",
    &vm_max_readahead,sizeof(int), 0644, NULL, &proc_dointvec},
+   {VM_MAX_MAP_COUNT, "max_map_count",
+    &max_map_count, sizeof(int), 0644, NULL, &proc_dointvec},
    {0}
 };
 
@@ -483,11 +485,11 @@
 }
 
 /**
- * register_sysctl_table - register a sysctl heirarchy
+ * register_sysctl_table - register a sysctl hierarchy
  * @table: the top-level table structure
  * @insert_at_head: whether the entry should be inserted in front or at the end
  *
- * Register a sysctl table heirarchy. @table should be a filled in ctl_table
+ * Register a sysctl table hierarchy. @table should be a filled in ctl_table
  * array. An entry with a ctl_name of 0 terminates the table. 
  *
  * The members of the &ctl_table structure are used as follows:
@@ -571,7 +573,7 @@
 }
 
 /**
- * unregister_sysctl_table - unregister a sysctl table heirarchy
+ * unregister_sysctl_table - unregister a sysctl table hierarchy
  * @header: the header returned from register_sysctl_table
  *
  * Unregisters the sysctl table and all children. proc entries may not
@@ -984,7 +986,7 @@
    vleft = table->maxlen / sizeof(int);
    left = *lenp;
    
-   for (; left && vleft--; i++, first=0) {
+   for (; left && vleft--; i++, min++, max++, first=0) {
       if (write) {
          while (left) {
             char c;
@@ -1020,9 +1022,7 @@
          buffer += len;
          left -= len;
 
-         if (min && val < *min++)
-            continue;
-         if (max && val > *max++)
+         if ((min && val < *min) || (max && val > *max))
             continue;
          *i = val;
       } else {


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.