From: nerdopolis Date: Fri, 2 Aug 2024 11:56:28 +0000 (-0400) Subject: ply-device-manager: Don't log an error when /sys/class/tty/console/active is empty X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dc6aa9e44d187ee2933b3f8fc438d24eb060ed9;p=thirdparty%2Fplymouth.git 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 --- diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c index 1f41e1b2..bbfbd50d 100644 --- a/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c @@ -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; }