[PATCH] Fix a Coverity issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix a Coverity issue

Samba - samba-technical mailing list
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:[hidden email]

patch.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix a Coverity issue

Samba - samba-technical mailing list
On Tue, Sep 05, 2017 at 01:18:42PM +0200, Volker Lendecke via samba-technical wrote:
> Hi!
>
> Review appreciated!

LGTM. Pushed !

> --
> 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:[hidden email]

> From deb9c6ede9bf441315b70eb5bc03e774fd4f10ef Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <[hidden email]>
> Date: Tue, 5 Sep 2017 13:17:54 +0200
> Subject: [PATCH] lib: Fix 1417431 Unchecked return value from library
>
> Signed-off-by: Volker Lendecke <[hidden email]>
> ---
>  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
>