ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'
ephyr_glamor_connect() returns NULL if we failed, but applying xcb_connection_has_error() to NULL is not permitted. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
This commit is contained in:
parent
391bcf77db
commit
82634d2b69
|
@ -443,7 +443,7 @@ hostx_init(void)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
HostX.conn = xcb_connect(NULL, &HostX.screen);
|
HostX.conn = xcb_connect(NULL, &HostX.screen);
|
||||||
if (xcb_connection_has_error(HostX.conn)) {
|
if (!HostX.conn || xcb_connection_has_error(HostX.conn)) {
|
||||||
fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
|
fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user