-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
***/
#include <errno.h>
+#include <pwd.h>
#include <string.h>
#include <unistd.h>
-#include <pwd.h>
#include "sd-messages.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
-#include "formats-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/"))
+ 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) {