summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-24 23:30:40 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:30:40 +0200
commit00229fe48f7577946bb95dd2b0ca96d8e6447f94 (patch)
treed32caa672ff0bdd905b1976b4030030a2f898528 /src
parent09c76ef618de6d3a095164910ec3c96ec89e4cbc (diff)
util: move logind_running() to login-util.[ch]
Diffstat (limited to 'src')
-rw-r--r--src/basic/login-util.h5
-rw-r--r--src/basic/util.h4
-rw-r--r--src/login/pam_systemd.c24
-rw-r--r--src/udev/udev-builtin-uaccess.c4
4 files changed, 20 insertions, 17 deletions
diff --git a/src/basic/login-util.h b/src/basic/login-util.h
index a79f20c1b1..be5bb64870 100644
--- a/src/basic/login-util.h
+++ b/src/basic/login-util.h
@@ -22,5 +22,10 @@
#pragma once
#include <stdbool.h>
+#include <unistd.h>
bool session_id_valid(const char *id);
+
+static inline bool logind_running(void) {
+ return access("/run/systemd/seats/", F_OK) >= 0;
+}
diff --git a/src/basic/util.h b/src/basic/util.h
index 7d1e4e0f62..d1da9ce106 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -617,10 +617,6 @@ static inline unsigned log2u_round_up(unsigned x) {
return log2u(x - 1) + 1;
}
-static inline bool logind_running(void) {
- return access("/run/systemd/seats/", F_OK) >= 0;
-}
-
#define DECIMAL_STR_WIDTH(x) \
({ \
typeof(x) _x_ = (x); \
diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
index f66f1ce842..63c31a6f62 100644
--- a/src/login/pam_systemd.c
+++ b/src/login/pam_systemd.c
@@ -19,31 +19,31 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <endian.h>
#include <errno.h>
#include <fcntl.h>
-#include <sys/file.h>
#include <pwd.h>
-#include <endian.h>
-
-#include <security/pam_modules.h>
#include <security/_pam_macros.h>
-#include <security/pam_modutil.h>
#include <security/pam_ext.h>
#include <security/pam_misc.h>
+#include <security/pam_modules.h>
+#include <security/pam_modutil.h>
+#include <sys/file.h>
-#include "bus-common-errors.h"
-#include "util.h"
#include "audit.h"
-#include "macro.h"
-#include "strv.h"
+#include "bus-common-errors.h"
+#include "bus-error.h"
#include "bus-util.h"
#include "def.h"
-#include "socket-util.h"
#include "fileio.h"
-#include "bus-error.h"
#include "formats-util.h"
-#include "terminal-util.h"
#include "hostname-util.h"
+#include "login-util.h"
+#include "macro.h"
+#include "socket-util.h"
+#include "strv.h"
+#include "terminal-util.h"
+#include "util.h"
static int parse_argv(
pam_handle_t *handle,
diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c
index 7bf4e7f24d..7a458063e4 100644
--- a/src/udev/udev-builtin-uaccess.c
+++ b/src/udev/udev-builtin-uaccess.c
@@ -22,7 +22,9 @@
#include <stdlib.h>
#include <errno.h>
-#include "systemd/sd-login.h"
+#include "sd-login.h"
+
+#include "login-util.h"
#include "logind-acl.h"
#include "udev.h"
#include "util.h"