]> git.ozlabs.org Git - petitboot/blobdiff - ui/common/joystick.c
ui/common: Set current console on boot command
[petitboot] / ui / common / joystick.c
index 94c85feba4ba1f1111e07d928879a04854e68b02..a3d6abd6acc37803809c75f6cbd887336bf54c0f 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -94,13 +93,13 @@ struct pjs *pjs_init(void *ctx, int (*map)(const struct js_event *))
 
        talloc_set_destructor(pjs, pjs_destructor);
 
-       pb_log("%s: using %s\n", __func__, dev_name);
+       pb_debug("%s: using %s\n", __func__, dev_name);
 
        return pjs;
 
 out_err:
-       close(pjs->fd);
-       pjs->fd = 0;
+       if (pjs->fd >= 0)
+               close(pjs->fd);
        talloc_free(pjs);
        return NULL;
 }