chiark / gitweb /
Prep v235: Apply pending upstream updates in src/login [3/4]
authorSven Eden <yamakuzure@gmx.net>
Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)
src/login/logind-utmp.c
src/login/meson.build

index 4fe5ff0144f2caf3b62e263ca907bf1feec72f80..2185db4b265353bddebac8ec2b51d75b42784f36 100644 (file)
@@ -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) {
index 9d6e7260c400c6c7ac8f11d6dc40c0c858dba5cc..acb91cb1eddc2139c2fb42c01e84bc73f246560c 100644 (file)
@@ -76,7 +76,6 @@ liblogind_core = static_library(
                         libaudit])
 #endif // 0
 
-
 loginctl_sources = files('''
         loginctl.c
         sysfs-show.h