ncurses/nc-cui: musl libc fixes
[petitboot] / ui / twin / pbt-scr.c
index e093c3c66b13fcc28defaa3d8b882a3d8d746511..e10cab10e9c9b817d8ae06a5c6a9da27b6c8fac7 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#if defined(HAVE_CONFIG_H)
 #include "config.h"
-#define _GNU_SOURCE
+#endif
+
 #include <assert.h>
 
 #include <string.h>
@@ -361,7 +363,7 @@ static int pbt_twin_waiter_cb(struct pbt_twin_ctx *twin_ctx)
 
 static void pbt_scr_destructor(struct pbt_scr *scr)
 {
-       pb_log("%s\n", __func__);
+       pb_debug("%s\n", __func__);
 
        twin_x11_destroy(scr->twin_ctx.x11);
        // FIXME: need cursor cleanup???
@@ -400,8 +402,8 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx,
 #if !defined(HAVE_LIBTWIN_TWIN_X11_H)
                assert(0);
 #else
-               scr->twin_ctx.x11 = twin_x11_create_ext(XOpenDisplay(0), width,
-                       height, 0);
+               scr->twin_ctx.x11 = twin_x11_create_ext(XOpenDisplay(NULL),
+                       width, height, 0);
 
                if (!scr->twin_ctx.x11) {
                        pb_log("%s: twin_x11_create_ext failed.\n", __func__);
@@ -409,7 +411,7 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx,
                        goto fail_ctx_create;
                }
 
-               pb_log("%s: x11: %p\n", __func__, scr->twin_ctx.x11);
+               pb_debug("%s: x11: %p\n", __func__, scr->twin_ctx.x11);
 
                assert(scr->twin_ctx.x11->screen);
                scr->tscreen = scr->twin_ctx.x11->screen;