]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-device-manager: Don't log an error when /sys/class/tty/console/active is empty
authornerdopolis <bluescreen_avenger@verizon.net>
Fri, 2 Aug 2024 11:56:28 +0000 (07:56 -0400)
committernerdopolis <bluescreen_avenger@verizon.net>
Fri, 2 Aug 2024 11:56:28 +0000 (07:56 -0400)
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

src/libply-splash-core/ply-device-manager.c

index 1f41e1b2927d1e093fb413cb43326629dde8e0c5..bbfbd50d7bfb2cdc216e16c102de6706f4c1487b 100644 (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;
         }