Skip to content

Commit 4e09e0d

Browse files
committed
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
2 parents ab91f6b + 786e676 commit 4e09e0d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

builtin/fsmonitor--daemon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state)
12111211
* events.
12121212
*/
12131213
if (pthread_create(&state->listener_thread, NULL,
1214-
fsm_listen__thread_proc, state) < 0) {
1214+
fsm_listen__thread_proc, state)) {
12151215
ipc_server_stop_async(state->ipc_server_data);
12161216
err = error(_("could not start fsmonitor listener thread"));
12171217
goto cleanup;
@@ -1222,7 +1222,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state)
12221222
* Start the health thread to watch over our process.
12231223
*/
12241224
if (pthread_create(&state->health_thread, NULL,
1225-
fsm_health__thread_proc, state) < 0) {
1225+
fsm_health__thread_proc, state)) {
12261226
ipc_server_stop_async(state->ipc_server_data);
12271227
err = error(_("could not start fsmonitor health thread"));
12281228
goto cleanup;

run-command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static void *run_thread(void *data)
10191019
sigset_t mask;
10201020
sigemptyset(&mask);
10211021
sigaddset(&mask, SIGPIPE);
1022-
if (pthread_sigmask(SIG_BLOCK, &mask, NULL) < 0) {
1022+
if (pthread_sigmask(SIG_BLOCK, &mask, NULL)) {
10231023
ret = error("unable to block SIGPIPE in async thread");
10241024
return (void *)ret;
10251025
}

0 commit comments

Comments
 (0)