summaryrefslogtreecommitdiff
path: root/src/xwayland
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-12-05 18:47:07 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-12-06 22:32:25 -0500
commitef94085ff1ad05c1604ad65fa9777976b8d4cdd4 (patch)
treee5d4620e20b87d4b8650d63fc8d243dcebd1f55a /src/xwayland
parent0b0be8eaf77366af5a108c7ec0d40c9a501231ea (diff)
downloadweston-ef94085ff1ad05c1604ad65fa9777976b8d4cdd4.tar.gz
weston-ef94085ff1ad05c1604ad65fa9777976b8d4cdd4.tar.bz2
weston-ef94085ff1ad05c1604ad65fa9777976b8d4cdd4.zip
xwayland: Close fd opened for lockfile on error path
Diffstat (limited to 'src/xwayland')
-rw-r--r--src/xwayland/launcher.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c
index 59154a3e..ddd9640c 100644
--- a/src/xwayland/launcher.c
+++ b/src/xwayland/launcher.c
@@ -247,6 +247,9 @@ create_lockfile(int display, char *lockfile, size_t lsize)
if (fd < 0 || read(fd, pid, 11) != 11) {
weston_log("can't read lock file %s: %s\n",
lockfile, strerror(errno));
+ if (fd >= 0)
+ close (fd);
+
errno = EEXIST;
return -1;
}