[PATCH 5/9] xwayland: Close fd opened for lockfile on error path

Rob Bradford robert.bradford at intel.com
Wed Dec 5 10:47:07 PST 2012


From: Rob Bradford <rob at linux.intel.com>

---
 src/xwayland/launcher.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c
index 59154a3..ddd9640 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;
 		}
-- 
1.7.11.7



More information about the wayland-devel mailing list