commit 9643dcb61ee2c7483afbf94ca9976557089936c8
parent b04602d4325fe094835095045196285746e089e5
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 5 Aug 2014 19:41:36 -0700
launch: Make failures in drm{Set,Drop}Master fatal
If these don't succeed, the display server cannot function.
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/launch/launch.c b/launch/launch.c
@@ -88,7 +88,10 @@ static void start_devices()
unsigned index;
for (index = 0; index < launcher.num_drm_fds; ++index)
- drmSetMaster(launcher.drm_fds[index]);
+ {
+ if (drmSetMaster(launcher.drm_fds[index]) < 0)
+ die("Failed to set DRM master");
+ }
}
static void stop_devices(bool fatal)
@@ -97,10 +100,8 @@ static void stop_devices(bool fatal)
for (index = 0; index < launcher.num_drm_fds; ++index)
{
- fprintf(stderr, "Dropping DRM master\n");
-
- if (drmDropMaster(launcher.drm_fds[index]) < 0)
- perror("Failed to drop DRM master");
+ if (drmDropMaster(launcher.drm_fds[index]) < 0 && fatal)
+ die("Failed to drop DRM master");
}
for (index = 0; index < launcher.num_input_fds; ++index)