1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 04:16:10 +02:00

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
This commit is contained in:
Junio C Hamano 2022-12-19 11:46:17 +09:00
commit 4e09e0dae6
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}