commit 9643dcb

Michael Forney  ·  2014-08-06 02:41:36 +0000 UTC
parent b04602d
launch: Make failures in drm{Set,Drop}Master fatal

If these don't succeed, the display server cannot function.
1 files changed,  +6, -5
+6, -5
 1@@ -88,7 +88,10 @@ static void start_devices()
 2     unsigned index;
 3 
 4     for (index = 0; index < launcher.num_drm_fds; ++index)
 5-        drmSetMaster(launcher.drm_fds[index]);
 6+    {
 7+        if (drmSetMaster(launcher.drm_fds[index]) < 0)
 8+            die("Failed to set DRM master");
 9+    }
10 }
11 
12 static void stop_devices(bool fatal)
13@@ -97,10 +100,8 @@ static void stop_devices(bool fatal)
14 
15     for (index = 0; index < launcher.num_drm_fds; ++index)
16     {
17-        fprintf(stderr, "Dropping DRM master\n");
18-
19-        if (drmDropMaster(launcher.drm_fds[index]) < 0)
20-            perror("Failed to drop DRM master");
21+        if (drmDropMaster(launcher.drm_fds[index]) < 0 && fatal)
22+            die("Failed to drop DRM master");
23     }
24 
25     for (index = 0; index < launcher.num_input_fds; ++index)