projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ec6450
)
qemu-ga: don't leak a file descriptor upon failed lockf
author
Jim Meyering
<meyering@redhat.com>
Wed, 22 Aug 2012 11:55:52 +0000
(13:55 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Wed, 22 Aug 2012 15:47:14 +0000
(10:47 -0500)
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-ga.c
patch
|
blob
|
history
diff --git
a/qemu-ga.c
b/qemu-ga.c
index 8f87621ae4ace3736604277ae31710db09c48d4d..26671fee3f61577505c63ddeec85ae502209d9c9 100644
(file)
--- a/
qemu-ga.c
+++ b/
qemu-ga.c
@@
-247,6
+247,9
@@
static bool ga_open_pidfile(const char *pidfile)
pidfd = open(pidfile, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR);
if (pidfd == -1 || lockf(pidfd, F_TLOCK, 0)) {
g_critical("Cannot lock pid file, %s", strerror(errno));
+ if (pidfd != -1) {
+ close(pidfd);
+ }
return false;
}