Blame SOURCES/0001-srp_daemon-Don-t-create-async_ev_thread-if-only-run-.patch

95af3a
From 441bf55e978cf37167d515a0d48773736cadfe2e Mon Sep 17 00:00:00 2001
95af3a
From: Honggang Li <honli@redhat.com>
95af3a
Date: Wed, 20 Dec 2017 03:09:58 +0800
95af3a
Subject: [PATCH] srp_daemon: Don't create async_ev_thread if only run once
95af3a
95af3a
fd3005f0cd34 moves the signal handler setup from ibsrpdm path. So,
95af3a
default signal handler will be used when the main pthread send signal
95af3a
SIGINT to pthread async_ev_thread. ibsrpdm will exit with non-zero
95af3a
exit code as default signal handler killed it. ibsrpdm should return
95af3a
with exit code zero, if no error emerged.
95af3a
95af3a
We should not create async_ev_thread for ibsrpdm.
95af3a
95af3a
Fixes: fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog")
95af3a
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
95af3a
Signed-off-by: Honggang Li <honli@redhat.com>
95af3a
Signed-off-by: Leon Romanovsky <leon@kernel.org>
95af3a
(cherry picked from commit 3f58c9237533ed9d92f3d08cad56527299781862)
95af3a
Signed-off-by: Honggang Li <honli@redhat.com>
95af3a
---
95af3a
 srp_daemon/srp_daemon.c | 10 +++++-----
95af3a
 1 file changed, 5 insertions(+), 5 deletions(-)
95af3a
95af3a
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
95af3a
index 2465ccd9..df6a8b17 100644
95af3a
--- a/srp_daemon/srp_daemon.c
95af3a
+++ b/srp_daemon/srp_daemon.c
95af3a
@@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void)
95af3a
 				     run_thread_get_trap_notices, &res->res);
95af3a
 		if (ret)
95af3a
 			goto err;
95af3a
-	}
95af3a
 
95af3a
-	ret = pthread_create(&res->res.async_ev_thread, NULL,
95af3a
-			     run_thread_listen_to_events, &res->res);
95af3a
-	if (ret)
95af3a
-		goto err;
95af3a
+		ret = pthread_create(&res->res.async_ev_thread, NULL,
95af3a
+				     run_thread_listen_to_events, &res->res);
95af3a
+		if (ret)
95af3a
+			goto err;
95af3a
+	}
95af3a
 
95af3a
 	if (config->retry_timeout && !config->once) {
95af3a
 		ret = pthread_create(&res->res.reconnect_thread, NULL,
95af3a
-- 
95af3a
2.15.GIT
95af3a