]> git.sesse.net Git - vlc/blobdiff - modules/control/globalhotkeys/xcb.c
Missing #include <errno.h>
[vlc] / modules / control / globalhotkeys / xcb.c
index 5aa894e4d5fa4613773e82f10c67fba5a89a8e8a..3b159986e66e27969fa39bf721c9faa50e224075 100644 (file)
@@ -28,6 +28,7 @@
 #include <vlc_interface.h>
 #include <vlc_keys.h>
 #include <ctype.h>
+#include <errno.h>
 
 #include <xcb/xcb.h>
 #include <xcb/xcb_keysyms.h>
@@ -100,8 +101,10 @@ static int Open( vlc_object_t *p_this )
         goto error;
 
     /* Get the root windows of the default screen */
-    memset( &p_sys->root, 0, sizeof( p_sys->root ) );
-    xcb_screen_iterator_t iter = xcb_setup_roots_iterator( xcb_get_setup( p_sys->p_connection ) );
+    const xcb_setup_t* xcbsetup = xcb_get_setup( p_sys->p_connection );
+    if( !xcbsetup )
+        goto error;
+    xcb_screen_iterator_t iter = xcb_setup_roots_iterator( xcbsetup );
     for( int i = 0; i < i_screen_default; i++ )
     {
         if( !iter.rem )