ply-device-manager: Don't log an error when /sys/class/tty/console/active is empty

This is possible on some kernels that were built with CONFIG_NULL_TTY enabled, and were booted with console=ttynull
/sys/class/tty/console/active is empty in this case, so the file being empty is not always an error worth logging
This commit is contained in:
nerdopolis 2024-08-02 07:56:28 -04:00
parent 6976081d6a
commit 2dc6aa9e44

View file

@ -974,7 +974,9 @@ add_consoles_from_file (ply_device_manager_t *manager,
contents_length = read (fd, contents, sizeof(contents) - 1);
if (contents_length <= 0) {
ply_trace ("couldn't read it: %m");
if (contents_length < 0)
ply_trace ("couldn't read it: %m");
close (fd);
return false;
}