diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-12-19 11:46:17 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-12-19 11:46:17 +0900 |
| commit | 4e09e0dae62f685935dd5b5dd0ec145b37d9cbe7 (patch) | |
| tree | f439f53e20945987c23f390df83363e1184287b9 | |
| parent | ab91f6b7c42531406bcca0e48c48530126332142 (diff) | |
| parent | 786e67611d46cd761e1aaa73f85b62f3dda1960a (diff) | |
| download | git-4e09e0dae62f685935dd5b5dd0ec145b37d9cbe7.tar.xz | |
Merge branch 'sx/pthread-error-check-fix'
Correct pthread API usage.
* sx/pthread-error-check-fix:
maintenance: compare output of pthread functions for inequality with 0
| -rw-r--r-- | builtin/fsmonitor--daemon.c | 4 | ||||
| -rw-r--r-- | run-command.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index 6607130c9f..0feef8caf6 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1211,7 +1211,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state) * events. */ if (pthread_create(&state->listener_thread, NULL, - fsm_listen__thread_proc, state) < 0) { + fsm_listen__thread_proc, state)) { ipc_server_stop_async(state->ipc_server_data); err = error(_("could not start fsmonitor listener thread")); goto cleanup; @@ -1222,7 +1222,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state) * Start the health thread to watch over our process. */ if (pthread_create(&state->health_thread, NULL, - fsm_health__thread_proc, state) < 0) { + fsm_health__thread_proc, state)) { ipc_server_stop_async(state->ipc_server_data); err = error(_("could not start fsmonitor health thread")); goto cleanup; diff --git a/run-command.c b/run-command.c index 48b9ba6d6f..756f1839aa 100644 --- a/run-command.c +++ b/run-command.c @@ -1019,7 +1019,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; } |
