summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 7c3da08dd8..4c4aed583e 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -36,6 +36,7 @@
#include <dirent.h>
#include <sys/resource.h>
#include <stddef.h>
+#include <unistd.h>
#include <systemd/sd-journal.h>
#include "macro.h"
@@ -639,3 +640,7 @@ static inline void _reset_umask_(struct umask_struct *s) {
static inline unsigned u64log2(uint64_t n) {
return (n > 1) ? __builtin_clzll(n) ^ 63U : 0;
}
+
+static inline bool logind_running(void) {
+ return access("/run/systemd/seats/", F_OK) >= 0;
+}