]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wall: do not error for ttys that do not exist
authorMike Gilbert <floppym@gentoo.org>
Sat, 29 Jul 2023 21:32:57 +0000 (17:32 -0400)
committerMike Gilbert <floppym@gentoo.org>
Wed, 2 Aug 2023 14:46:19 +0000 (10:46 -0400)
Some wayland display managers (GDM) put strings like "seat0" in the
ut_line field of utmp entries. These are not valid tty devices.

Avoid writing a confusing error message for ttys that do not exist.

Bug: https://bugs.gentoo.org/911336
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
term-utils/ttymsg.c

index 14d6ca64708e132136497d0cad121dcc9dc67bd4..faa0344feb349dada2b8fdfc870ef4a79d33b55c 100644 (file)
@@ -100,7 +100,7 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
         * if not running as root; not an error.
         */
        if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) < 0) {
-               if (errno == EBUSY || errno == EACCES)
+               if (errno == EBUSY || errno == EACCES || errno == ENOENT)
                        return NULL;
 
                len = snprintf(errbuf, sizeof(errbuf), "%s: %m", device);