selinux: fix 'defined but not used' warning
PATCH 1/1 selinux: fix 'defined but not used' warning
selinux is initialized lazily, so if selinux is disabled then selinux_init will never be called.
This lets udev compile with -Werror again.
Signed-off-by Alan Jenkins <[email protected]>
udev/lib/libudev.c +2 -2
@@ -72,9 +72,9 @@ static void log_stderr(struct udev *udev,vfprintf (stderr, format, args); } +#ifdef USE_SELINUX static void selinux_init (struct udev *udev) { -#ifdef USE_SELINUX /* * record the present security context, for file-creation * restoration creation purposes.
@@ -89,8 +89,8 @@ static void selinux_init(struct udev *udev) } } udev->selinux_initialized =1 ; -#endif } +#endif void *udev_get_userdata (struct udev *udev) {
Quoted 3 lines · Alan Jenkins
selinux is initialized lazily, so if selinux is disabled then
selinux_initwill never be called.This lets udev compile with -Werror again.
Oh, I just ripped out that crap an hour ago, and use it only where needed. Even "Hello world" will initialize selinux on startup. I was tired seeing it parsing /proc/mounts and whatever else in strace. So much for "lazy" init. :)
Thanks,
Kay