virsh-domain: Fix error handling of pthread_sigmask

pthread_sigmask() returns 0 on success and "a non-zero value
on failure", but not neccessarily a negative one.

Found by clang-tidy's "bugprone-posix-return" check.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-02-01 13:42:01 +01:00 committed by Peter Krempa
parent 2870d99f1b
commit 4f5c22b27c

View File

@ -4226,7 +4226,7 @@ doSave(void *opaque)
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0)
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) != 0)
goto out_sig;
#endif /* !WIN32 */
@ -4756,7 +4756,7 @@ doManagedsave(void *opaque)
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0)
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) != 0)
goto out_sig;
#endif /* !WIN32 */
@ -5438,7 +5438,7 @@ doDump(void *opaque)
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0)
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) != 0)
goto out_sig;
#endif /* !WIN32 */
@ -10726,7 +10726,7 @@ doMigrate(void *opaque)
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0)
if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) != 0)
goto out_sig;
#endif /* !WIN32 */