aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-06 01:18:01 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-06 02:17:39 +0200
commit4d2ff9a173aab781f995fa7e69ca65543daf7ad6 (patch)
tree368c5b43faa19b64659ddb223c88e453f80338c9
parentb6e421bcbede4750ed59bc7a87a36b0b9370a685 (diff)
assert: Use printf_sync() to ensure printing of assert / paniclaforge/cardem1
-rw-r--r--firmware/libcommon/include/assert.h2
-rw-r--r--firmware/libosmocore/source/panic.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/firmware/libcommon/include/assert.h b/firmware/libcommon/include/assert.h
index 22bb101..dc6b1b5 100644
--- a/firmware/libcommon/include/assert.h
+++ b/firmware/libcommon/include/assert.h
@@ -89,7 +89,7 @@
/// \param condition Condition to verify.
#define ASSERT(condition) { \
if (!(condition)) { \
- printf("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \
+ printf_sync("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \
while (1); \
} \
}
diff --git a/firmware/libosmocore/source/panic.c b/firmware/libosmocore/source/panic.c
index 74243b0..db5c26a 100644
--- a/firmware/libosmocore/source/panic.c
+++ b/firmware/libosmocore/source/panic.c
@@ -46,7 +46,7 @@ static osmo_panic_handler_t osmo_panic_handler = (void*)0;
__attribute__ ((format (printf, 1, 0)))
static void osmo_panic_default(const char *fmt, va_list args)
{
- vfprintf(stderr, fmt, args);
+ vfprintf_sync(stderr, fmt, args);
osmo_generate_backtrace();
assert(0);
}