From: Kent Overstreet Date: Thu, 31 Mar 2022 03:20:39 +0000 (-0400) Subject: Flush standard output before popping assertions X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=cc1b64e992b52d19b24cdc7677fc451c60d2c9d4;p=bcachefs-tools-debian Flush standard output before popping assertions Seeing error messages before we die generally makes assertions easier to debug. Signed-off-by: Kent Overstreet --- diff --git a/include/linux/bug.h b/include/linux/bug.h index 77260f3..957d408 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -17,7 +17,7 @@ #define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)])) -#define BUG() do { assert(0); unreachable(); } while (0) +#define BUG() do { fflush(stdout); assert(0); unreachable(); } while (0) #define BUG_ON(cond) assert(!(cond)) #define WARN(cond, fmt, ...) \