#endif
/* report a bug on stderr */
-void complain(int *counter, const char *msg, uint details);
+void complain(uint details, const char *msg);
void ha_backtrace_to_stderr(int hint);
/* Let's make DEBUG_STRESS equal to zero if not set or not valid, or to
#define __ABORT_NOW(file, line, ...) do { \
if (sizeof("" __VA_ARGS__) > 1) \
- complain(NULL, "\nABORT at " file ":" #line ": " __VA_ARGS__ "\n", DBG_FATL_ABT); \
+ complain(DBG_FATL_ABT, "\nABORT at " file ":" #line ": " __VA_ARGS__ "\n"); \
ha_backtrace_to_stderr(1); \
abort_with_line(__LINE__); \
} while (0)
msg ="\n" pfx "condition \"" #cond "\" matched at " file ":" #line "" sfx "\n" __VA_ARGS__ "\n"; \
else \
msg = "\n" pfx "condition \"" #cond "\" matched at " file ":" #line "" sfx "\n"; \
- complain(NULL, msg, details); \
+ complain(details, msg); \
if (details & DBG_DET_FAT_FATL) \
ABORT_NOW(); \
else if (details & DBG_DET_FAT_WARN) \
msg = "\n" pfx "condition \"" #cond "\" matched at " file ":" #line "" sfx "\n"; \
if (_HA_ATOMIC_FETCH_ADD(&__match_count_##line, 1)) \
break; \
- complain(NULL, msg, details); \
+ complain(details, msg); \
if (details & DBG_DET_FAT_FATL) \
ABORT_NOW(); \
else if (details & DBG_DET_FAT_WARN) \
DISGUISE(write(2, buf.area, buf.data));
}
-/* Complain with message <msg> on stderr. If <counter> is not NULL, it is
- * atomically incremented, and the message is only printed when the counter
- * was zero, so that the message is only printed once. <details> is only
+/* Complain with message <msg> on stderr. <details> is only
* checked on DBG_DET_TYP_BUG, and will taint the process either for a
* bug or warn.
*/
-void complain(int *counter, const char *msg, uint details)
+void complain(uint details, const char *msg)
{
- if (counter && _HA_ATOMIC_FETCH_ADD(counter, 1))
- return;
DISGUISE(write(2, msg, strlen(msg)));
if (details & (DBG_DET_TYP_BUG|DBG_DET_TYP_ABT))
mark_tainted(TAINTED_BUG);