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>
* 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);