All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] selinux: fix 'defined but not used' warning
Date: Thu, 02 Oct 2008 16:29:03 +0000	[thread overview]
Message-ID: <48E4F6CF.80503@tuffmail.co.uk> (raw)

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 <alan-jenkins@tuffmail.co.uk>

diff --git a/udev/lib/libudev.c b/udev/lib/libudev.c
index c2c5025..16cf860 100644
--- a/udev/lib/libudev.c
+++ b/udev/lib/libudev.c
@@ -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)
 {


             reply	other threads:[~2008-10-02 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 16:29 Alan Jenkins [this message]
2008-10-02 16:56 ` [PATCH] selinux: fix 'defined but not used' warning Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48E4F6CF.80503@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.