Spotted by Coverity. Also document why we keep it open on success. Signed-off-by: Markus Armbruster <[email protected]> --- 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
