mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
assert: Use printf_sync() to ensure printing of assert / panic
Change-Id: Icc202e60445d9be1cdcd61176db5ed1704d583e7
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
/// \param condition Condition to verify.
|
/// \param condition Condition to verify.
|
||||||
#define ASSERT(condition) { \
|
#define ASSERT(condition) { \
|
||||||
if (!(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); \
|
while (1); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ static osmo_panic_handler_t osmo_panic_handler = (void*)0;
|
|||||||
__attribute__ ((format (printf, 1, 0)))
|
__attribute__ ((format (printf, 1, 0)))
|
||||||
static void osmo_panic_default(const char *fmt, va_list args)
|
static void osmo_panic_default(const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf_sync(stderr, fmt, args);
|
||||||
osmo_generate_backtrace();
|
osmo_generate_backtrace();
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user