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

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


They do not use any functions from libcap directly. The CAP_* constants in use
through these files come from "missing.h" which will import <linux/capability.h>
and complement it with CAP_* constants not defined by the current kernel
headers. The "missing.h" header is imported through "util.h" which gets
imported in "logind.h".

Tested that "systemd-logind" builds cleanly and works after this change.
---
 src/login/logind-dbus.c         | 1 -
 src/login/logind-seat-dbus.c    | 1 -
 src/login/logind-session-dbus.c | 1 -
 src/login/logind-user-dbus.c    | 1 -
 4 files changed, 4 deletions(-)

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 8ea653f..c0d1309 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -23,7 +23,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <pwd.h>
-#include <sys/capability.h>
 
 #include "sd-id128.h"
 #include "sd-messages.h"
diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c
index ff87f0f..a99d008 100644
--- a/src/login/logind-seat-dbus.c
+++ b/src/login/logind-seat-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "util.h"
 #include "bus-util.h"
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index 8607d03..4e75d5b 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "util.h"
 #include "strv.h"
diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c
index 51793f6..812a19f 100644
--- a/src/login/logind-user-dbus.c
+++ b/src/login/logind-user-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "strv.h"
 #include "bus-util.h"
-- 
1.8.3.1



More information about the systemd-devel mailing list