MINOR: debug: make mark_tainted() return the previous value

Since mark_tainted() uses atomic ops to update the tainted status, let's
make it return the prior value, which will allow the caller to detect
if it's the first one to set it or not.

(cherry picked from commit 8e048603d1bba0721433a5ae0480fbf1ab6f4897)
Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
Willy Tarreau 2024-10-19 15:12:47 +02:00
parent 6d98108aa9
commit 922bd2d1c6

View File

@ -320,9 +320,9 @@ extern unsigned int tainted;
void complain(int *counter, const char *msg, int taint);
static inline void mark_tainted(const enum tainted_flags flag)
static inline unsigned int mark_tainted(const enum tainted_flags flag)
{
HA_ATOMIC_OR(&tainted, flag);
return HA_ATOMIC_FETCH_OR(&tainted, flag);
}
static inline unsigned int get_tainted()