X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ui%2Fncurses%2Fps3-main.c;h=eda15d05e2230388cf779860bbf34eef2241a7c7;hb=1ad18bf128c4edfae76adaffd9c7801355f29b91;hp=1269549b7f8ac13a5dbff83b581d2d64a74f8ef2;hpb=089d0a6eb769d531129a7cd1061493a1a24b4bef;p=petitboot diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c index 1269549..eda15d0 100644 --- a/ui/ncurses/ps3-main.c +++ b/ui/ncurses/ps3-main.c @@ -24,9 +24,9 @@ * ncurses mouse support */ +#if defined(HAVE_CONFIG_H) #include "config.h" - -#define _GNU_SOURCE +#endif #include #include @@ -407,11 +407,19 @@ static struct pmenu *ps3_mm_init(struct ps3_cui *ps3_cui) m = pmenu_init(ps3_cui->cui, 3, cui_on_exit); if (!m) { - pb_log("%s: failed\n", __func__); + pb_log_fn("failed\n"); return NULL; } - m->hot_key = ps3_hot_key; + m->n_hot_keys = 2; + m->hot_keys = talloc_array(m, hot_key_fn *, m->n_hot_keys); + if (!m->hot_keys) { + pb_log_fn("failed to allocate hot_keys\n"); + talloc_free(m); + return NULL; + } + m->hot_keys[0] = ps3_hot_key; + m->hot_keys[1] = pmenu_main_hot_keys; m->on_new = cui_item_new; #if defined(DEBUG) @@ -466,7 +474,7 @@ static struct pmenu *ps3_svm_init(struct ps3_cui *ps3_cui) m = pmenu_init(ps3_cui->cui, 12, ps3_svm_to_mm_helper); if (!m) { - pb_log("%s: failed\n", __func__); + pb_log_fn("failed\n"); return NULL; } @@ -613,7 +621,7 @@ int main(int argc, char *argv[]) result += sigaction(SIGWINCH, &sa, NULL); if (result) { - pb_log("%s sigaction failed.\n", __func__); + pb_log_fn("sigaction failed.\n"); return EXIT_FAILURE; }