diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-08-30 07:49:50 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-08-30 07:49:50 +0200 |
commit | a18031c1db3d7115cf6088e560cfcc488ea87bb0 (patch) | |
tree | 187e5d4fdee2668a54e436975a36099dff148ff5 /src | |
parent | ef5a8c7aa11fe727f531d90fb679608dfc22599a (diff) |
Prep v235: Apply pending upstream updates in src/login [3/4]
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-utmp.c | 11 | ||||
-rw-r--r-- | 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 |