compositor-drm: Exit if we failed to get drm master
We can do anything without drm master. Also log an error in case we fail to drop it, which will be trouble for whoever we're switching to.
This commit is contained in:
@@ -795,7 +795,10 @@ vt_func(struct weston_compositor *compositor, int event)
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case TTY_ENTER_VT:
|
case TTY_ENTER_VT:
|
||||||
compositor->focus = 1;
|
compositor->focus = 1;
|
||||||
drmSetMaster(ec->drm.fd);
|
if (drmSetMaster(ec->drm.fd)) {
|
||||||
|
fprintf(stderr, "failed to set master: %m\n");
|
||||||
|
wl_display_terminate(compositor->wl_display);
|
||||||
|
}
|
||||||
compositor->state = ec->prev_state;
|
compositor->state = ec->prev_state;
|
||||||
weston_compositor_damage_all(compositor);
|
weston_compositor_damage_all(compositor);
|
||||||
wl_list_for_each(input, &compositor->input_device_list, link)
|
wl_list_for_each(input, &compositor->input_device_list, link)
|
||||||
@@ -811,7 +814,9 @@ vt_func(struct weston_compositor *compositor, int event)
|
|||||||
wl_list_for_each(output, &ec->base.output_list, link)
|
wl_list_for_each(output, &ec->base.output_list, link)
|
||||||
drm_output_set_cursor(output, NULL);
|
drm_output_set_cursor(output, NULL);
|
||||||
|
|
||||||
drmDropMaster(ec->drm.fd);
|
if (drmDropMaster(ec->drm.fd) < 0)
|
||||||
|
fprintf(stderr, "failed to drop master: %m\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user