]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: fix inverted conditional in active console reading code
authorRay Strode <rstrode@redhat.com>
Wed, 4 Apr 2012 15:28:26 +0000 (11:28 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 4 Apr 2012 15:30:26 +0000 (11:30 -0400)
We were failing when read succeeded, not when it failed, so
we were always reverting to fallback.

src/main.c

index 095f5357d3ca9480a8ed75c62e5072c233ca94ca..5a2f8b18bf942ba5f1c60d27646a08a00d3ec4a4 100644 (file)
@@ -1892,7 +1892,7 @@ add_consoles_from_file (state_t         *state,
     }
 
   ply_trace ("reading file");
-  if (read (fd, contents, sizeof (contents)))
+  if (read (fd, contents, sizeof (contents)) <= 0)
     {
       ply_trace ("couldn't read it: %m");
       close (fd);