On Fri, Jan 11, 2013 at 11:24:59AM +0100, Markus Armbruster wrote:
> Spotted by Coverity.  Also document why we keep it open on success.
> 
> Signed-off-by: Markus Armbruster <arm...@redhat.com>

Reviewed-by: Michael Roth <mdr...@linux.vnet.ibm.com>

> ---
>  qga/main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/qga/main.c b/qga/main.c
> index 1a22d8d..db47427 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -286,10 +286,12 @@ static bool ga_open_pidfile(const char *pidfile)
>          goto fail;
>      }
> 
> +    /* keep pidfile open & locked forever */
>      return true;
> 
>  fail:
>      unlink(pidfile);
> +    close(pidfd);
>      return false;
>  }
>  #else /* _WIN32 */
> -- 
> 1.7.11.7
> 

Reply via email to