[systemd-devel] [PATCH 9/9] capabilities: remove spurious include of <sys/capability.h> from sd-dbus sources

Filipe Brandenburger filbranden at google.com
Tue Dec 23 10:38:50 PST 2014


They do not use any functions from libcap directly. The CAP_SYS_ADMIN constant
in use by bus-objects.c comes from <linux/capability.h> imported through
"missing.h". The "missing.h" header is imported through "util.h" which gets
imported in "bus-util.h".

Tested that everything builds cleanly after this change.
---
 src/libsystemd/sd-bus/bus-objects.c | 2 --
 src/libsystemd/sd-bus/bus-util.c    | 1 -
 2 files changed, 3 deletions(-)

diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 6162d12..e64743f 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -19,8 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/capability.h>
-
 #include "strv.h"
 #include "set.h"
 #include "bus-internal.h"
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
index 0f1a89c..06e6d84 100644
--- a/src/libsystemd/sd-bus/bus-util.c
+++ b/src/libsystemd/sd-bus/bus-util.c
@@ -20,7 +20,6 @@
 ***/
 
 #include <sys/socket.h>
-#include <sys/capability.h>
 
 #include "systemd/sd-daemon.h"
 
-- 
1.8.3.1



More information about the systemd-devel mailing list