+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
#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"
}
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) {