1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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 <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May 16 19:08:29 UTC 2019 on sn-devel-184
This commit is contained in:
Rikard Falkeborn 2019-05-09 21:17:24 +02:00 committed by Andreas Schneider
parent 0fa490e847
commit 749f1290ce

View File

@ -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++) {