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

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