summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-31 15:02:56 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-31 15:54:03 +0200
commitb5cb2d2847a3516ba794acf07d08f70d988ff7c2 (patch)
treee6f2a9e46123a99771428e98db4a06f76f15e201
parentMerge pull request #23562 from yuwata/fix-typo (diff)
downloadsystemd-b5cb2d2847a3516ba794acf07d08f70d988ff7c2.tar.xz
systemd-b5cb2d2847a3516ba794acf07d08f70d988ff7c2.zip
tty-ask-password-agent: drop unnecessary code for non-absolute paths
utmp_wall() always prepends /dev/, so we don't need to do this a second time here.
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 7fc0ed7c8d..09835ca903 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -99,8 +99,7 @@ static bool wall_tty_match(const char *path, void *userdata) {
_cleanup_close_ int fd = -1;
struct stat st;
- if (!path_is_absolute(path))
- path = strjoina("/dev/", path);
+ assert(path_is_absolute(path));
if (lstat(path, &st) < 0) {
log_debug_errno(errno, "Failed to stat %s: %m", path);