File bug-1063051_0003-clvmd-check-for-pthread_create-status.patch of Package lvm2.7683
From a73f8430bfad7a83541d748a395b6053a80fbafd Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Mon, 9 Nov 2015 09:23:27 +0100
Subject: [PATCH 04/10] clvmd: check for pthread_create status
Coverity: likes to see checked function result.
(cherry picked from commit 9df3069083cd49f75e0ec54fc1e699b057129934)
---
daemons/clvmd/clvmd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 217a016..923fa4b 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -604,7 +604,10 @@ int main(int argc, char *argv[])
local_client_head.fd, &local_client_head, newfd->fd, newfd);
/* Don't let anyone else to do work until we are started */
- pthread_create(&lvm_thread, &stack_attr, lvm_thread_fn, &lvm_params);
+ if (pthread_create(&lvm_thread, &stack_attr, lvm_thread_fn, &lvm_params)) {
+ log_sys_error("pthread_create", "");
+ goto out;
+ }
/* Don't start until the LVM thread is ready */
pthread_barrier_wait(&lvm_start_barrier);
--
2.10.2