]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: move display_is_local() to pam_systemd.c, its only user
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Mar 2019 11:27:52 +0000 (12:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 14 Mar 2019 12:25:51 +0000 (13:25 +0100)
It's quite specific anyway, hence let's move this where it's used

src/basic/util.c
src/basic/util.h
src/login/pam_systemd.c

index ed91cabde55f12471f711073fd5f928da773915b..93d610bc9890b629d6e5ac16be22f2e96f3ff71c 100644 (file)
@@ -51,15 +51,6 @@ int saved_argc = 0;
 char **saved_argv = NULL;
 static int saved_in_initrd = -1;
 
-bool display_is_local(const char *display) {
-        assert(display);
-
-        return
-                display[0] == ':' &&
-                display[1] >= '0' &&
-                display[1] <= '9';
-}
-
 bool kexec_loaded(void) {
        _cleanup_free_ char *s = NULL;
 
index d1a8a8f3b47ac9928c6aeb4a2050217fe2f8fea8..469f3eee4d7a27981a0fa1de9e605e9658e5f016 100644 (file)
@@ -43,8 +43,6 @@ static inline const char* enable_disable(bool b) {
         return b ? "enable" : "disable";
 }
 
-bool display_is_local(const char *display) _pure_;
-
 #define NULSTR_FOREACH(i, l)                                    \
         for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
 
index 997b74eb88a917df2f64d334a4c02f4d018da85f..8c90141ad9be077337b05de999a6e42498a4a9ae 100644 (file)
@@ -115,6 +115,15 @@ static int get_user_data(
         return PAM_SUCCESS;
 }
 
+static bool display_is_local(const char *display) {
+        assert(display);
+
+        return
+                display[0] == ':' &&
+                display[1] >= '0' &&
+                display[1] <= '9';
+}
+
 static int socket_from_display(const char *display, char **path) {
         size_t k;
         char *f, *c;