Cleaned up udev-selinux patch

Greg KH greg at kroah.com
Thu Aug 26 22:56:40 UTC 2004


On Thu, Aug 26, 2004 at 11:59:28PM +0100, Luke Kenneth Casson Leighton wrote:
> perhaps the style should be that the Makefile adds some code
> add_selinux.c based on a configure-time option,
> 
> and that some #ifdefs in a header file call a function which
> is a stub in the header if WITH_SELINUX is not defined.
> 
> bizarre_but_likely_quite_good_coding_style_never_encountered_before.h:

You've never read Linux kernel code, have you :)

> #ifdef WITH_SELINUX
> int do_add_selinux_stuff(args) { return 0; }

Logic is backwards here.

> #else
> #define do_add_selinux_stuff the_real_add_selinux_stuff

This define is unncessary.  Just call the function
do_add_selinux_stuff(), and protype it.

Actually, inline functions that do nothing if selinux is disabled is
better to catch compiler errors with types if things change in the
future.

thanks,

greg k-h



More information about the fedora-selinux-list mailing list