From: Lennart Poettering Date: Thu, 14 Mar 2019 11:27:52 +0000 (+0100) Subject: util: move display_is_local() to pam_systemd.c, its only user X-Git-Tag: v242-rc1~130^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecd5f1a9e060746258e8f93e8ba6b331e49e92f3;p=thirdparty%2Fsystemd.git util: move display_is_local() to pam_systemd.c, its only user It's quite specific anyway, hence let's move this where it's used --- diff --git a/src/basic/util.c b/src/basic/util.c index ed91cabde55..93d610bc989 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -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; diff --git a/src/basic/util.h b/src/basic/util.h index d1a8a8f3b47..469f3eee4d7 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -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) diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 997b74eb88a..8c90141ad9b 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -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;