From 0b2b9a7b17476757fb8589888ee660d25dca2e88 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 26 Mar 2019 17:13:42 +0100 Subject: [PATCH] dont error out if path thread already terminated --- lib/path.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/path.c b/lib/path.c index 8c4df33b8..3a13af76b 100644 --- a/lib/path.c +++ b/lib/path.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -611,10 +612,13 @@ int path_stop(struct path *p) if (p->state != STATE_STOPPING) p->state = STATE_STOPPING; - /* Cancel the thread in case is currently in a blocking syscall */ + /* Cancel the thread in case is currently in a blocking syscall. + * + * We dont care if the thread has already been terminated. + */ ret = pthread_cancel(p->tid); - if (ret) - return ret; + if (ret && ret != ESRCH) + return ret; ret = pthread_join(p->tid, NULL); if (ret)