mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 00:05:40 +02:00
misc: xcb_connect() always returns a non-NULL pointer
Instead, we need to check if xcb_connection_has_error() says something went wrong. We also need to call xcb_disconnect() on the disfunctional XCB connection object.
This commit is contained in:
parent
406d6b3b83
commit
9d5bbe0566
5 changed files with 29 additions and 11 deletions
3
xcb.c
3
xcb.c
|
@ -48,8 +48,9 @@ bool
|
|||
xcb_init(void)
|
||||
{
|
||||
xcb_connection_t *conn = xcb_connect(NULL, NULL);
|
||||
if (conn == NULL) {
|
||||
if (xcb_connection_has_error(conn) > 0) {
|
||||
LOG_ERR("failed to connect to X");
|
||||
xcb_disconnect(conn);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue