Re: [PATCH] sysctl braindamage

From: Stephen C. Tweedie (sct@scot.redhat.com)
Date: Tue Mar 21 2000 - 12:31:57 EST


Hi,

On Sun, Mar 19, 2000 at 02:20:56PM +1100, Rusty Russell wrote:
> The sysctl internal interface is horrible: if you don't #if
> CONFIG_SYSCTL everywhere (yuk), you get much bloat, and *worse*,
> register_sysctl_table() always "fails".

Yes. Returning a null table if you try to register one is obviously the
correct thing to do: the caller can then avoid trying to dereference the
table if we aren't running with CONFIG_SYSCTL.

> + /* NULL would mean failure. */
> + return (struct ctl_table_header *)1;

Eek, that looks _much_ worse! The caller has no idea that this isn't a
valid pointer.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:33 EST