]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tty-ask-password-agent: drop unnecessary code for non-absolute paths
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 31 May 2022 13:02:56 +0000 (15:02 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 31 May 2022 13:54:03 +0000 (15:54 +0200)
utmp_wall() always prepends /dev/, so we don't need to do this a second
time here.

src/tty-ask-password-agent/tty-ask-password-agent.c

index 7fc0ed7c8d799507526b15109f7300120cb78600..09835ca90369ab767a9c7eb920d4ca2cca428a5e 100644 (file)
@@ -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);