From: Rikard Falkeborn Date: Thu, 9 May 2019 19:17:24 +0000 (+0200) Subject: lib:util: Fix tfork return value if sigprocmask fails X-Git-Tag: tdb-1.4.1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=749f1290ce654d2d47e84ff455212b008de6b54c;p=thirdparty%2Fsamba.git 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 --- 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++) {