]> git.itanic.dy.fi Git - rrdd/commitdiff
debug: Flush debug prints out immedeatly
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 18:21:37 +0000 (21:21 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 18:21:37 +0000 (21:21 +0300)
This should ensure log output is free of possible corruptions due to
stdio buffering.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
debug.h

diff --git a/debug.h b/debug.h
index ea6c69a8c9750b72910f14d0edae077af201feac..3507c90d2ec8f77de800e84f11a041d09bcb661b 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -23,6 +23,7 @@ extern const char normal_color[];
                        fmt, green_color, time, indent,                 \
                        getpid(), get_parent_count(),                   \
                        __FILE__, __LINE__, normal_color, ##arg);       \
+               fflush(stderr);                                         \
        } while (0)
 
 
@@ -40,6 +41,7 @@ extern const char normal_color[];
                        fmt, red_color, time, indent,                   \
                        getpid(), get_parent_count(),                   \
                        __FILE__, __LINE__, normal_color, ##arg);       \
+               fflush(stderr);                                         \
        } while (0)
 
 #endif