leak-checker: Make output file unbuffered.
authorBen Pfaff <blp@nicira.com>
Wed, 14 Jan 2009 00:21:18 +0000 (16:21 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 14 Jan 2009 00:21:18 +0000 (16:21 -0800)
This way, we get an up-to-date record when the process is killed.

lib/leak-checker.c

index bdff32478e36cc1a8aa7e6cb887bbd5c37a3b70e..a50d5c8801a0dbe60b365670cd98c6a84f66d691 100644 (file)
@@ -113,6 +113,7 @@ leak_checker_start(const char *file_name)
                       file_name, strerror(errno));
             return;
         }
+        setvbuf(file, NULL, _IONBF, 0);
         VLOG_WARN("enabled memory leak logging to \"%s\"", file_name);
         get_hooks(&libc_hooks);
         set_hooks(&our_hooks);