summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-04-30 14:27:04 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-30 14:27:48 -0400
commit1d887a10056bdb80e5b6becdba20e0325f38712e (patch)
tree5edc2c5e34f53a15bbd1c5f020e2d93822e60611
parentf485d5ffdd9f2f75741d562dc813ecc13f380f4c (diff)
ecore_drm: close fd if flag set fails
@fix Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2454
-rw-r--r--src/lib/ecore_drm/ecore_drm_launcher.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_launcher.c b/src/lib/ecore_drm/ecore_drm_launcher.c
index e66918a6f0..ae28be0e8d 100644
--- a/src/lib/ecore_drm/ecore_drm_launcher.c
+++ b/src/lib/ecore_drm/ecore_drm_launcher.c
@@ -140,8 +140,10 @@ _ecore_drm_launcher_device_open_no_pending(const char *device, int flags)
140 if (logind) 140 if (logind)
141 { 141 {
142 fd = _ecore_drm_logind_device_open_no_pending(device); 142 fd = _ecore_drm_logind_device_open_no_pending(device);
143 if ((fd = _ecore_drm_launcher_device_flags_set(fd, flags)) < 0) 143 if (fd < 0) return -1;
144 if (_ecore_drm_launcher_device_flags_set(fd, flags) < 0)
144 { 145 {
146 close(fd);
145 _ecore_drm_logind_device_close(device); 147 _ecore_drm_logind_device_close(device);
146 return -1; 148 return -1;
147 } 149 }