From 749f1290ce654d2d47e84ff455212b008de6b54c Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Thu, 9 May 2019 21:17:24 +0200 Subject: [PATCH] lib:util: Fix tfork return value if sigprocmask fails Returning a non-zero value from a function with bool as return value is the same as returning true. Change the return value to false if sigprocmask or pthread_sigmask fails to indicate failure. Detected with the help of cppcheck. Signed-off-by: Rikard Falkeborn Reviewed-by: Ralph Boehme Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu May 16 19:08:29 UTC 2019 on sn-devel-184 --- lib/util/tests/tfork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c index ef3a6f717d0..8a6197fc00f 100644 --- a/lib/util/tests/tfork.c +++ b/lib/util/tests/tfork.c @@ -490,7 +490,7 @@ static bool test_tfork_threads(struct torture_context *tctx) ret = sigprocmask(SIG_UNBLOCK, &set, NULL); #endif if (ret != 0) { - return -1; + return false; } for (i = 0; i < num_threads; i++) { -- 2.47.3