From a18031c1db3d7115cf6088e560cfcc488ea87bb0 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Wed, 30 Aug 2017 07:49:50 +0200 Subject: [PATCH] Prep v235: Apply pending upstream updates in src/login [3/4] --- src/login/logind-utmp.c | 11 ++++++++--- src/login/meson.build | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/login/logind-utmp.c b/src/login/logind-utmp.c index 4fe5ff014..2185db4b2 100644 --- a/src/login/logind-utmp.c +++ b/src/login/logind-utmp.c @@ -31,6 +31,7 @@ #include "bus-util.h" #include "format-util.h" #include "logind.h" +#include "path-util.h" //#include "special.h" #include "strv.h" #include "unit-name.h" @@ -60,15 +61,19 @@ _const_ static usec_t when_wall(usec_t n, usec_t elapse) { } bool logind_wall_tty_filter(const char *tty, void *userdata) { - Manager *m = userdata; + const char *p; assert(m); - if (!startswith(tty, "/dev/") || !m->scheduled_shutdown_tty) + if (!m->scheduled_shutdown_tty) + return true; + + p = path_startswith(tty, "/dev/"); + if (!p) return true; - return !streq(tty + 5, m->scheduled_shutdown_tty); + return !streq(p, m->scheduled_shutdown_tty); } static int warn_wall(Manager *m, usec_t n) { diff --git a/src/login/meson.build b/src/login/meson.build index 9d6e7260c..acb91cb1e 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -76,7 +76,6 @@ liblogind_core = static_library( libaudit]) #endif // 0 - loginctl_sources = files(''' loginctl.c sysfs-show.h -- 2.30.2