From: Zbigniew Jędrzejewski-Szmek Date: Tue, 31 May 2022 13:02:56 +0000 (+0200) Subject: tty-ask-password-agent: drop unnecessary code for non-absolute paths X-Git-Tag: v252-rc1~887^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5cb2d2847a3516ba794acf07d08f70d988ff7c2;p=thirdparty%2Fsystemd.git 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. --- 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 7fc0ed7c8d7..09835ca9036 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);