]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] Don't try to write debug buffer if open fails
authorRay Strode <rstrode@redhat.com>
Mon, 24 Aug 2009 17:48:01 +0000 (13:48 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 24 Aug 2009 17:48:01 +0000 (13:48 -0400)
Before we would try to use the fd causing assertion failures.

src/main.c

index d3f8ebb2dade77b583b604b505fab17e4e04b77f..c98bdf7e2f12492419446c5753a87c57fa920ba8 100644 (file)
@@ -1330,6 +1330,10 @@ dump_debug_buffer_to_file (void)
 
   fd = open (debug_buffer_path,
              O_WRONLY | O_CREAT, 0600);
+
+  if (fd < 0)
+    return;
+
   size = ply_buffer_get_size (debug_buffer);
   bytes = ply_buffer_get_bytes (debug_buffer);
   ply_write (fd, bytes, size);