[PATCH] Fix a Coverity issue
Volker Lendecke
Volker.Lendecke at SerNet.DE
Tue Sep 5 11:18:42 UTC 2017
Hi!
Review appreciated!
Thanks, Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From deb9c6ede9bf441315b70eb5bc03e774fd4f10ef Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 5 Sep 2017 13:17:54 +0200
Subject: [PATCH] lib: Fix 1417431 Unchecked return value from library
Signed-off-by: Volker Lendecke <vl at samba.org>
---
lib/pthreadpool/tests.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/pthreadpool/tests.c b/lib/pthreadpool/tests.c
index 999118286eb..1aab80c2bb4 100644
--- a/lib/pthreadpool/tests.c
+++ b/lib/pthreadpool/tests.c
@@ -232,7 +232,11 @@ static int test_busyfork(void)
return -1;
}
- poll(NULL, 0, 200);
+ ret = poll(NULL, 0, 200);
+ if (ret == -1) {
+ perror("poll failed");
+ return -1;
+ }
child = fork();
if (child < 0) {
@@ -278,7 +282,11 @@ static int test_busyfork(void)
return -1;
}
- poll(NULL, 0, 200);
+ ret = poll(NULL, 0, 200);
+ if (ret == -1) {
+ perror("poll failed");
+ return -1;
+ }
waitret = waitpid(child, &wstatus, WNOHANG);
if (waitret != child) {
--
2.11.0
More information about the samba-technical
mailing list