ecore_drm: close fd if flag set fails

@fix

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2454
This commit is contained in:
Derek Foreman 2015-04-30 14:27:04 -04:00 committed by Chris Michael
parent f485d5ffdd
commit 1d887a1005
1 changed files with 3 additions and 1 deletions

View File

@ -140,8 +140,10 @@ _ecore_drm_launcher_device_open_no_pending(const char *device, int flags)
if (logind)
{
fd = _ecore_drm_logind_device_open_no_pending(device);
if ((fd = _ecore_drm_launcher_device_flags_set(fd, flags)) < 0)
if (fd < 0) return -1;
if (_ecore_drm_launcher_device_flags_set(fd, flags) < 0)
{
close(fd);
_ecore_drm_logind_device_close(device);
return -1;
}