]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] Truncate output debug file
authorCharlie Brej <cbrej@cs.man.ac.uk>
Tue, 13 Oct 2009 21:20:11 +0000 (22:20 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Tue, 13 Oct 2009 21:20:11 +0000 (22:20 +0100)
Truncates the debug file to clear any previous data. Previously, if a run had a
shorter debug data, some data from a previous run would still be present at the
end of the file.

src/main.c

index 66c0f5151172ad44a860ee8dffe2b0e130e8d45f..77f839b2d2dda96323053fbc12b69f93a43b8a65 100644 (file)
@@ -1409,7 +1409,7 @@ dump_debug_buffer_to_file (void)
   size_t size;
 
   fd = open (debug_buffer_path,
-             O_WRONLY | O_CREAT, 0600);
+             O_WRONLY | O_CREAT | O_TRUNC, 0600);
 
   if (fd < 0)
     return;