weston-launch: Only store drm fd if we successfully opened and stat'ed it

This commit is contained in:
Kristian Høgsberg 2013-10-09 11:25:14 -07:00
parent 4a74d5a4a4
commit af393dcc69
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ err0:
if (len < 0)
return -1;
if (major(s.st_rdev) == DRM_MAJOR)
if (fd != -1 && major(s.st_rdev) == DRM_MAJOR)
wl->drm_fd = fd;
return 0;