Blame SOURCES/open-iscsi-2.0.876-31-Fix-iscsiuio-segfault-when-shutting-down.patch

e88930
From: Chris Leech <cleech@redhat.com>
e88930
Subject: Fix iscsiuio segfault when shutting down.
e88930
e88930
Bugzilla: ZZZ
e88930
Upstream Status:
e88930
Build Info: XXX
e88930
Tested:
e88930
e88930
commit 2bdcae8a9969295183377342cfe218d1c5d263db
e88930
Author: Lee Duncan <lduncan@suse.com>
e88930
Date:   Thu May 31 08:42:58 2018 -0700
e88930
e88930
    Fix iscsiuio segfault when shutting down.
e88930
    
e88930
    If iscsiuio is stopped when first starting up, it can easily
e88930
    hit a window where pthread_cancel() is called before pthread_create()
e88930
    finishesx The problem was found by kiyo@jp.fujitsu.com, who also
e88930
    proposed the fix.
e88930
---
e88930
 iscsiuio/src/unix/iscsid_ipc.c | 3 ++-
e88930
 1 file changed, 2 insertions(+), 1 deletion(-)
e88930
e88930
diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c
e88930
index d4322350fcf6..2acac485af72 100644
e88930
--- a/iscsiuio/src/unix/iscsid_ipc.c
e88930
+++ b/iscsiuio/src/unix/iscsid_ipc.c
e88930
@@ -1245,7 +1245,8 @@ void iscsid_cleanup()
e88930
 {
e88930
 	int rc;
e88930
 
e88930
-	if (iscsid_opts.fd != INVALID_FD) {
e88930
+	if (iscsid_opts.fd != INVALID_FD &&
e88930
+	    iscsid_opts.thread != INVALID_THREAD) {
e88930
 		rc = pthread_cancel(iscsid_opts.thread);
e88930
 		if (rc != 0) {
e88930
 			LOG_ERR("Could not cancel iscsid listening thread: %s",