Skip to content
Snippets Groups Projects
Commit 70a3a976 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

errinj: fix ERROR_INJECT_COUNTDOWN

We shouldn't decrement the counter if it's negative - otherwise it may
wrap around and mistakenly trigger the error injection.

NO_DOC=internal
NO_TEST=internal
NO_CHANGELOG=internal

(cherry picked from commit d11d4576b0d0cbfc03dc1a3570573b7bbf1126b5)
parent c42b850d
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,8 @@ void errinj_set_with_environment_vars(void);
} while (0)
# define ERROR_INJECT_COUNTDOWN(ID, CODE) \
do { \
if (errinj(ID, ERRINJ_INT)->iparam-- == 0) { \
if (errinj(ID, ERRINJ_INT)->iparam >= 0 && \
errinj(ID, ERRINJ_INT)->iparam-- == 0) { \
CODE; \
} \
} while (0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment