summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent
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 /src/tty-ask-password-agent
parent35207b14cf2bdd4b80742abbe3852b23aa6a3559 (diff)
downloadsystemd-b5cb2d2847a3516ba794acf07d08f70d988ff7c2.tar.gz
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.
Diffstat (limited to 'src/tty-ask-password-agent')
-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);