Small glitch in kernel/sysctl.c?

Roderich Schupp (rsch@ExperTeam.de)
Tue, 14 Apr 1998 00:41:04 +0200


Hi,
will looking over the sysctl stuff in kernel/sysctl.c I was wondering:
shouldn't function sysctl_string return 1, i.e.

--- kernel/sysctl.c~ Sat Apr 11 17:06:43 1998
+++ kernel/sysctl.c Tue Apr 14 00:30:58 1998
@@ -897,7 +897,7 @@
translations_dirty = 1;
#endif
}
- return 0;
+ return 1;
}

/*

That's because it's used as a sysctl strategy handler,
and as such has already done the transfer to/from userspace,
hence the generic strategy handler can just return. (Otherwise
it will to the transfer a second time.) If the above is correct, then
the only caller of sysctl_string (besides do_sysctl_strategy)
- which is nametrans_string (currently unused) - should be changed
accordingly:

--- fs/nametrans.c~ Mon Dec 1 19:34:11 1997
+++ fs/nametrans.c Tue Apr 14 00:38:34 1998
@@ -285,7 +285,7 @@
int res;
check_dirty();
res = sysctl_string(table, name, nlen, oldval, oldlenp, newval,
newlen, context);
- if(!res && newval && newlen)
+ if(res >= 0 && newval && newlen)
nametrans_setup(nametrans_txt);

return res;

Cheers, Roderich

--
WHAT? I thought these were stuffed peppers.  Honey, what the heck IS this??
               Whatever it is, I'm not eating it!
Roderich Schupp          mailto:rsch@ExperTeam.de
ExperTeam GmbH           http://www.experteam.de/
Munich, Germany               linux:2.1.95

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu