Skip to content

Commit

Permalink
srp_daemon: Don't create async_ev_thread if only run once
Browse files Browse the repository at this point in the history
fd3005f moves the signal handler setup from ibsrpdm path. So,
default signal handler will be used when the main pthread send signal
SIGINT to pthread async_ev_thread. ibsrpdm will exit with non-zero
exit code as default signal handler killed it. ibsrpdm should return
with exit code zero, if no error emerged.

We should not create async_ev_thread for ibsrpdm.

Fixes: fd3005f ("srp_daemon: Move the setup of the wakeup_pipe after openlog")
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Honggang Li <honli@redhat.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
  • Loading branch information
Honggang-LI authored and nmorey committed Jan 3, 2018
1 parent 2c08bb9 commit 2b996ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions srp_daemon/srp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void)
run_thread_get_trap_notices, &res->res);
if (ret)
goto err;
}

ret = pthread_create(&res->res.async_ev_thread, NULL,
run_thread_listen_to_events, &res->res);
if (ret)
goto err;
ret = pthread_create(&res->res.async_ev_thread, NULL,
run_thread_listen_to_events, &res->res);
if (ret)
goto err;
}

if (config->retry_timeout && !config->once) {
ret = pthread_create(&res->res.reconnect_thread, NULL,
Expand Down

0 comments on commit 2b996ef

Please sign in to comment.