diff options
author | Seija <doremylover123@gmail.com> | 2022-12-02 18:02:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-05 02:15:54 +0100 |
commit | 786e67611d46cd761e1aaa73f85b62f3dda1960a (patch) | |
tree | fccb324ff39356045f3031ef4c6b005794a0d96b /run-command.c | |
parent | Downmerge a bit more for 2.38.2 (diff) | |
download | git-786e67611d46cd761e1aaa73f85b62f3dda1960a.tar.xz git-786e67611d46cd761e1aaa73f85b62f3dda1960a.zip |
maintenance: compare output of pthread functions for inequality with 0
The documentation for pthread_create and pthread_sigmask state that:
"On success, pthread_create() returns 0;
on error, it returns an error number"
As such, we ought to check for an error
by seeing if the output is not 0.
Checking for "less than" is a mistake
as the error code numbers can be greater than 0.
Signed-off-by: Seija <doremylover123@gmail.com>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index 5ec3a46dcc..14040f0276 100644 --- a/run-command.c +++ b/run-command.c @@ -1054,7 +1054,7 @@ static void *run_thread(void *data) sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGPIPE); - if (pthread_sigmask(SIG_BLOCK, &mask, NULL) < 0) { + if (pthread_sigmask(SIG_BLOCK, &mask, NULL)) { ret = error("unable to block SIGPIPE in async thread"); return (void *)ret; } |