diff mbox

[30/33] tur: Add pthread_testcancel()

Message ID 20170228162329.14517-31-mwilck@suse.com (mailing list archive)
State Superseded, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Martin Wilck Feb. 28, 2017, 4:23 p.m. UTC
From: Hannes Reinecke <hare@suse.de>

When the ioctl returns we need to check if a cancellation has
been requested; otherwise we'd be re-setting the state and
overwrite any pending values.


Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 libmultipath/checkers/tur.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c
index d9a9e67d..b4a5cb2f 100644
--- a/libmultipath/checkers/tur.c
+++ b/libmultipath/checkers/tur.c
@@ -268,6 +268,7 @@  static void *tur_thread(void *ctx)
 	pthread_mutex_unlock(&ct->lock);
 
 	state = tur_check(ct->fd, ct->timeout, copy_msg_to_tcc, ct->message);
+	pthread_testcancel();
 
 	/* TUR checker done */
 	pthread_mutex_lock(&ct->lock);