lkml.org 
[lkml]   [2000]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysctl braindamage
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean