diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/common/discover-client.c | 20 | ||||
-rw-r--r-- | ui/common/joystick.c | 4 | ||||
-rw-r--r-- | ui/common/ps3.c | 18 | ||||
-rw-r--r-- | ui/common/timer.c | 2 | ||||
-rw-r--r-- | ui/common/ui-system.c | 2 | ||||
-rw-r--r-- | ui/ncurses/generic-main.c | 2 | ||||
-rw-r--r-- | ui/ncurses/nc-cui.c | 36 | ||||
-rw-r--r-- | ui/ncurses/nc-menu.c | 8 | ||||
-rw-r--r-- | ui/ncurses/ps3-main.c | 8 | ||||
-rw-r--r-- | ui/twin/main-generic.c | 4 | ||||
-rw-r--r-- | ui/twin/main-ps3.c | 2 | ||||
-rw-r--r-- | ui/twin/pbt-client.c | 12 | ||||
-rw-r--r-- | ui/twin/pbt-scr.c | 16 |
13 files changed, 67 insertions, 67 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 88d0b4e..d941497 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -197,7 +197,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_device(dev, message); if (rc) { - pb_log("%s: no device?\n", __func__); + pb_log_fn("no device?\n"); goto out; } @@ -208,7 +208,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_boot_option(opt, message); if (rc) { - pb_log("%s: no boot_option?\n", __func__); + pb_log_fn("no boot_option?\n"); goto out; } @@ -217,7 +217,7 @@ static int discover_client_process(void *arg) case PB_PROTOCOL_ACTION_DEVICE_REMOVE: dev_id = pb_protocol_deserialise_string(ctx, message); if (!dev_id) { - pb_log("%s: no device id?\n", __func__); + pb_log_fn("no device id?\n"); goto out; } device_remove(client, dev_id); @@ -227,7 +227,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_boot_status(status, message); if (rc) { - pb_log("%s: invalid status message?\n", __func__); + pb_log_fn("invalid status message?\n"); goto out; } update_status(client, status); @@ -237,7 +237,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_system_info(sysinfo, message); if (rc) { - pb_log("%s: invalid sysinfo message?\n", __func__); + pb_log_fn("invalid sysinfo message?\n"); goto out; } update_sysinfo(client, sysinfo); @@ -247,7 +247,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_config(config, message); if (rc) { - pb_log("%s: invalid config message?\n", __func__); + pb_log_fn("invalid config message?\n"); goto out; } update_config(client, config); @@ -257,7 +257,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_plugin_option(p_opt, message); if (rc) { - pb_log("%s: no plugin_option?\n", __func__); + pb_log_fn("no plugin_option?\n"); goto out; } @@ -267,7 +267,7 @@ static int discover_client_process(void *arg) plugins_remove(client); break; default: - pb_log("%s: unknown action %d\n", __func__, message->action); + pb_log_fn("unknown action %d\n", message->action); } out: @@ -291,7 +291,7 @@ struct discover_client* discover_client_init(struct waitset *waitset, client->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (client->fd < 0) { - pb_log("%s: socket: %s\n", __func__, strerror(errno)); + pb_log_fn("socket: %s\n", strerror(errno)); goto out_err; } @@ -304,7 +304,7 @@ struct discover_client* discover_client_init(struct waitset *waitset, strcpy(addr.sun_path, PB_SOCKET_PATH); if (connect(client->fd, (struct sockaddr *)&addr, sizeof(addr))) { - pb_log("%s: connect: %s\n", __func__, strerror(errno)); + pb_log_fn("connect: %s\n", strerror(errno)); goto out_err; } diff --git a/ui/common/joystick.c b/ui/common/joystick.c index a3d6abd..f75ae3d 100644 --- a/ui/common/joystick.c +++ b/ui/common/joystick.c @@ -47,7 +47,7 @@ int pjs_process_event(const struct pjs *pjs) result = read(pjs->fd, &e, sizeof(e)); if (result != sizeof(e)) { - pb_log("%s: read failed: %s\n", __func__, strerror(errno)); + pb_log_fn("read failed: %s\n", strerror(errno)); return 0; } @@ -86,7 +86,7 @@ struct pjs *pjs_init(void *ctx, int (*map)(const struct js_event *)) pjs->fd = open(dev_name, O_RDONLY | O_NONBLOCK); if (pjs->fd < 0) { - pb_log("%s: open %s failed: %s\n", __func__, dev_name, + pb_log_fn("open %s failed: %s\n", dev_name, strerror(errno)); goto out_err; } diff --git a/ui/common/ps3.c b/ui/common/ps3.c index c9b97b5..d2a57a5 100644 --- a/ui/common/ps3.c +++ b/ui/common/ps3.c @@ -79,7 +79,7 @@ static int ps3_flash_open(struct ps3_flash_ctx *fc, const char *mode) fc->dev = fopen(flash_dev, mode); if (!fc->dev) { - pb_log("%s: fopen failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("fopen failed: %s: %s\n", strerror(errno), flash_dev); return -1; } @@ -89,7 +89,7 @@ static int ps3_flash_open(struct ps3_flash_ctx *fc, const char *mode) result = os_area_fixed_read(&fc->header, &fc->params, fc->dev); if (result) { - pb_log("%s: os_area_fixed_read failed\n", __func__); + pb_log_fn("os_area_fixed_read failed\n"); goto fail; } @@ -123,7 +123,7 @@ int ps3_flash_get_values(struct ps3_flash_values *values) ps3_flash_close(&fc); if (result) { - pb_log("%s: os_area_db_read failed: %s\n", __func__, + pb_log_fn("os_area_db_read failed: %s\n", strerror(errno)); goto fail; } @@ -176,14 +176,14 @@ int ps3_flash_set_values(const struct ps3_flash_values *values) result = os_area_db_read(&fc.db, &fc.header, fc.dev); if (result) { - pb_log("%s: os_area_db_read failed: %s\n", __func__, + pb_log_fn("os_area_db_read failed: %s\n", strerror(errno)); - pb_log("%s: formating db\n", __func__); + pb_log_fn("formating db\n"); result = os_area_db_format(&fc.db, &fc.header, fc.dev); if (result) { - pb_log("%s: db_format failed: %s\n", __func__, + pb_log_fn("db_format failed: %s\n", strerror(errno)); goto fail; } @@ -220,7 +220,7 @@ static int ps3_video_ioctl(int request, unsigned int *mode_id) fd = open(fb_dev, O_RDWR); if (fd < 0) { - pb_log("%s: open failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("open failed: %s: %s\n", strerror(errno), fb_dev); return -1; } @@ -230,7 +230,7 @@ static int ps3_video_ioctl(int request, unsigned int *mode_id) close(fd); if (result < 0) { - pb_log("%s: ioctl failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("ioctl failed: %s: %s\n", strerror(errno), fb_dev); return -1; } @@ -266,6 +266,6 @@ int ps3_get_video_mode(unsigned int *mode_id) result = ps3_video_ioctl(PS3FB_IOCTL_GETMODE, mode_id); - pb_log("%s: %u\n", __func__, *mode_id); + pb_log_fn("%u\n", *mode_id); return result; } diff --git a/ui/common/timer.c b/ui/common/timer.c index b0cae0d..23c3e62 100644 --- a/ui/common/timer.c +++ b/ui/common/timer.c @@ -35,7 +35,7 @@ void ui_timer_init(struct waitset *waitset, struct ui_timer *timer, unsigned int seconds) { - pb_log("%s: %u\n", __func__, seconds); + pb_log_fn("%u\n", seconds); timer->timeout = seconds; timer->waitset = waitset; } diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c index 7e04801..02142db 100644 --- a/ui/common/ui-system.c +++ b/ui/common/ui-system.c @@ -78,7 +78,7 @@ unsigned int pb_elf_hash(const char *str) h ^= g >> 24; h &= ~g; } - pb_log("%s: %x\n", __func__, h); + pb_log_fn("%x\n", h); return h; } diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 7062796..096eb56 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -245,7 +245,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; } diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 87d2503..3abeac3 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -169,7 +169,7 @@ static void cui_atexit(void) void cui_abort(struct cui *cui) { - pb_log("%s: exiting\n", __func__); + pb_log_fn("exiting\n"); cui->abort = 1; } @@ -254,7 +254,7 @@ int cui_run_cmd(struct cui *cui, const char **cmd_argv) nc_scr_post(cui->current); if (result) { - pb_log("%s: failed: '%s'\n", __func__, cmd_argv[0]); + pb_log_fn("failed: '%s'\n", cmd_argv[0]); nc_scr_status_printf(cui->current, _("Failed: %s"), cmd_argv[0]); } @@ -688,7 +688,7 @@ static void cui_handle_resize(struct cui *cui) struct winsize ws; if (ioctl(1, TIOCGWINSZ, &ws) == -1) { - pb_log("%s: ioctl failed: %s\n", __func__, strerror(errno)); + pb_log_fn("ioctl failed: %s\n", strerror(errno)); return; } @@ -783,7 +783,7 @@ static int cui_boot_option_add(struct device *dev, struct boot_option *opt, result = set_menu_items(menu->ncm, NULL); if (result) - pb_log("%s: set_menu_items failed: %d\n", __func__, result); + pb_log_fn("set_menu_items failed: %d\n", result); /* Insert new items at insert_pt. */ if (dev_hdr) { @@ -798,10 +798,10 @@ static int cui_boot_option_add(struct device *dev, struct boot_option *opt, } if (plugin_option) { - pb_log("%s: adding plugin '%s'\n", __func__, cod->name); + pb_log_fn("adding plugin '%s'\n", cod->name); pb_log(" file '%s'\n", cod->pd->plugin_file); } else { - pb_log("%s: adding opt '%s'\n", __func__, cod->name); + pb_log_fn("adding opt '%s'\n", cod->name); pb_log(" image '%s'\n", cod->bd->image); pb_log(" initrd '%s'\n", cod->bd->initrd); pb_log(" args '%s'\n", cod->bd->args); @@ -826,14 +826,14 @@ static int cui_boot_option_add(struct device *dev, struct boot_option *opt, } result = set_menu_items(cui->main->ncm, cui->main->items); if (result) - pb_log("%s: set_menu_items failed: %d\n", __func__, result); + pb_log_fn("set_menu_items failed: %d\n", result); } /* Re-attach the items array. */ result = set_menu_items(menu->ncm, menu->items); if (result) - pb_log("%s: set_menu_items failed: %d\n", __func__, result); + pb_log_fn("set_menu_items failed: %d\n", result); if (0) { pb_log("%s\n", __func__); @@ -878,7 +878,7 @@ static void cui_device_remove(struct device *dev, void *arg) int rows, cols, top, last; int result; - pb_log("%s: %p %s\n", __func__, dev, dev->id); + pb_log_fn("%p %s\n", dev, dev->id); if (cui->current == &cui->main->scr) nc_scr_unpost(cui->current); @@ -891,7 +891,7 @@ static void cui_device_remove(struct device *dev, void *arg) result |= set_menu_items(cui->plugin_menu->ncm, NULL); if (result) - pb_log("%s: set_menu_items failed: %d\n", __func__, result); + pb_log_fn("set_menu_items failed: %d\n", result); list_for_each_entry(&dev->boot_options, opt, list) { struct pmenu_item *item = pmenu_item_from_arg(opt->ui_info); @@ -948,7 +948,7 @@ static void cui_device_remove(struct device *dev, void *arg) } if (result) - pb_log("%s: set_menu_items failed: %d\n", __func__, result); + pb_log_fn("set_menu_items failed: %d\n", result); if (0) { pb_log("%s\n", __func__); @@ -1300,14 +1300,14 @@ static struct pmenu *main_menu_init(struct cui *cui) m = pmenu_init(cui, 9, cui_on_exit); if (!m) { - pb_log("%s: failed\n", __func__); + pb_log_fn("failed\n"); return NULL; } m->n_hot_keys = 1; m->hot_keys = talloc_array(m, hot_key_fn, m->n_hot_keys); if (!m->hot_keys) { - pb_log("%s: failed to allocate hot_keys\n", __func__); + pb_log_fn("failed to allocate hot_keys\n"); talloc_free(m); return NULL; } @@ -1506,7 +1506,7 @@ struct cui *cui_init(void* platform_info, cui = talloc_zero(NULL, struct cui); if (!cui) { - pb_log("%s: alloc cui failed.\n", __func__); + pb_log_fn("alloc cui failed.\n"); fprintf(stderr, _("%s: alloc cui failed.\n"), __func__); goto fail_alloc; } @@ -1526,7 +1526,7 @@ retry_start: &cui_client_ops, cui); if (cui->client || !i) break; - pb_log("%s: waiting for server %d\n", __func__, i); + pb_log_fn("waiting for server %d\n", i); sleep(1); } @@ -1540,7 +1540,7 @@ retry_start: if (!result) goto retry_start; - pb_log("%s: discover_client_init failed.\n", __func__); + pb_log_fn("discover_client_init failed.\n"); fprintf(stderr, _("%s: error: discover_client_init failed.\n"), __func__); fprintf(stderr, _("could not start pb-discover, the petitboot " @@ -1554,7 +1554,7 @@ retry_start: waiter_register_timeout(cui->waitset, 0, cui_server_wait, cui); } else if (!cui->client) { - pb_log("%s: discover_client_init failed.\n", __func__); + pb_log_fn("discover_client_init failed.\n"); fprintf(stderr, _("%s: error: discover_client_init failed.\n"), __func__); fprintf(stderr, _("check that pb-discover, " @@ -1653,7 +1653,7 @@ int cui_run(struct cui *cui) int result = waiter_poll(cui->waitset); if (result < 0) { - pb_log("%s: poll: %s\n", __func__, strerror(errno)); + pb_log_fn("poll: %s\n", strerror(errno)); break; } diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c index a6c2b15..a90a02e 100644 --- a/ui/ncurses/nc-menu.c +++ b/ui/ncurses/nc-menu.c @@ -117,7 +117,7 @@ static const char *pmenu_item_label(struct pmenu_item *item, const char *name) label = talloc_array(item, char, len + 1); wcstombs(label, tmp, len + 1); - pb_log("%s: %s\n", __func__, label); + pb_log_fn("%s\n", label); talloc_free(tmp); return label; @@ -357,7 +357,7 @@ static int pmenu_item_get_index(const struct pmenu_item *item) if (item->pmenu->items[i] == item->nci) return i; - pb_log("%s: not found: %p %s\n", __func__, item, + pb_log_fn("not found: %p %s\n", item, (item ? item->nci->name.str : "(null)")); return -1; } @@ -491,7 +491,7 @@ unsigned int pmenu_grow(struct pmenu *menu, unsigned int count) assert(item_count(menu->ncm) == 0 && "not disconnected"); - pb_log("%s: %u current + %u new = %u\n", __func__, menu->item_count, + pb_log_fn("%u current + %u new = %u\n", menu->item_count, count, menu->item_count + count); /* Note that items array has a null terminator. */ @@ -526,7 +526,7 @@ int pmenu_remove(struct pmenu *menu, struct pmenu_item *item) assert(menu->item_count); - pb_log("%s: %u\n", __func__, menu->item_count); + pb_log_fn("%u\n", menu->item_count); index = pmenu_item_get_index(item); diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c index f60a05e..eda15d0 100644 --- a/ui/ncurses/ps3-main.c +++ b/ui/ncurses/ps3-main.c @@ -407,14 +407,14 @@ 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->n_hot_keys = 2; m->hot_keys = talloc_array(m, hot_key_fn *, m->n_hot_keys); if (!m->hot_keys) { - pb_log("%s: failed to allocate hot_keys\n", __func__); + pb_log_fn("failed to allocate hot_keys\n"); talloc_free(m); return NULL; } @@ -474,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; } @@ -621,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; } diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c index 8ddec9e..a85cace 100644 --- a/ui/twin/main-generic.c +++ b/ui/twin/main-generic.c @@ -204,7 +204,7 @@ static int run(struct pbt_client *client) int result = waiter_poll(client->waitset); if (result < 0) { - pb_log("%s: poll: %s\n", __func__, strerror(errno)); + pb_log_fn("poll: %s\n", strerror(errno)); break; } @@ -304,7 +304,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; } diff --git a/ui/twin/main-ps3.c b/ui/twin/main-ps3.c index ba4b1d7..f98aca8 100644 --- a/ui/twin/main-ps3.c +++ b/ui/twin/main-ps3.c @@ -411,7 +411,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; } diff --git a/ui/twin/pbt-client.c b/ui/twin/pbt-client.c index 48de816..cffb5de 100644 --- a/ui/twin/pbt-client.c +++ b/ui/twin/pbt-client.c @@ -66,7 +66,7 @@ static int pbt_client_boot(struct pbt_item *item) NULL, opt_data->opt, opt_data->bd); if (result) { - pb_log("%s: failed: %s\n", __func__, opt_data->bd->image); + pb_log_fn("failed: %s\n", opt_data->bd->image); pbt_frame_status_printf(&item->pbt_client->frame, "Failed: kexec %s", opt_data->bd->image); } @@ -194,7 +194,7 @@ static void pbt_device_remove(struct device *dev, struct pbt_client *client) } if (!removed_item) { - pb_log("%s: %p %s: unknown device\n", __func__, dev, dev->id); + pb_log_fn("%p %s: unknown device\n", dev, dev->id); assert(0 && "unknown device"); return; } @@ -260,7 +260,7 @@ struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, pbt_client = talloc_zero(NULL, struct pbt_client); if (!pbt_client) { - pb_log("%s: alloc pbt_client failed.\n", __func__); + pb_log_fn("alloc pbt_client failed.\n"); fprintf(stderr, "%s: alloc pbt_client failed.\n", __func__); goto fail_alloc; } @@ -288,7 +288,7 @@ retry_start: &pbt_client_ops, pbt_client); if (pbt_client->discover_client || !i) break; - pb_log("%s: waiting for server %d\n", __func__, i); + pb_log_fn("waiting for server %d\n", i); sleep(1); } @@ -302,7 +302,7 @@ retry_start: if (!result) goto retry_start; - pb_log("%s: discover_client_init failed.\n", __func__); + pb_log_fn("discover_client_init failed.\n"); fprintf(stderr, "%s: error: discover_client_init failed.\n", __func__); fprintf(stderr, "could not start pb-discover, the petitboot " @@ -311,7 +311,7 @@ retry_start: } if (!pbt_client->discover_client) { - pb_log("%s: discover_client_init failed.\n", __func__); + pb_log_fn("discover_client_init failed.\n"); fprintf(stderr, "%s: error: discover_client_init failed.\n", __func__); fprintf(stderr, "check that pb-discover, " diff --git a/ui/twin/pbt-scr.c b/ui/twin/pbt-scr.c index e10cab1..c360047 100644 --- a/ui/twin/pbt-scr.c +++ b/ui/twin/pbt-scr.c @@ -138,7 +138,7 @@ twin_pixmap_t *pbt_background_load(twin_screen_t *tscreen, raw_background = twin_jpeg_to_pixmap(filename, TWIN_ARGB32); if (!raw_background) { - pb_log("%s: loading image '%s' failed\n", __func__, filename); + pb_log_fn("loading image '%s' failed\n", filename); /* Fallback to a default pattern */ @@ -158,7 +158,7 @@ twin_pixmap_t *pbt_background_load(twin_screen_t *tscreen, tscreen->width, tscreen->height); if (!scaled_background) { - pb_log("%s: scale '%s' failed\n", __func__, filename); + pb_log_fn("scale '%s' failed\n", filename); twin_pixmap_destroy(raw_background); return twin_make_pattern(); } @@ -224,7 +224,7 @@ retry: new.icon = twin_png_to_pixmap(filename, TWIN_ARGB32); if (!new.icon) { - pb_log("%s: loading image '%s' failed\n", __func__, filename); + pb_log_fn("loading image '%s' failed\n", filename); if (filename == default_icon_file) return NULL; @@ -384,7 +384,7 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx, assert(backend && backend < 3); if (!scr) { - pb_log("%s: alloc pbt_scr failed.\n", __func__); + pb_log_fn("alloc pbt_scr failed.\n"); goto fail_alloc; } @@ -395,7 +395,7 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx, scr->twin_ctx.backend = backend; if (backend == pbt_twin_x11) { - pb_log("%s: using twin x11 backend.\n", __func__); + pb_log_fn("using twin x11 backend.\n"); assert(width > 100); assert(height > 100); @@ -406,7 +406,7 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx, width, height, 0); if (!scr->twin_ctx.x11) { - pb_log("%s: twin_x11_create_ext failed.\n", __func__); + pb_log_fn("twin_x11_create_ext failed.\n"); perror("failed to create twin x11 context\n"); goto fail_ctx_create; } @@ -418,14 +418,14 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx, waiter_fd = ConnectionNumber(scr->twin_ctx.x11->dpy); #endif } else if (backend == pbt_twin_fbdev) { - pb_log("%s: using twin fbdev backend.\n", __func__); + pb_log_fn("using twin fbdev backend.\n"); #if !defined(HAVE_LIBTWIN_TWIN_FBDEV_H) assert(0); #else scr->twin_ctx.fbdev = twin_fbdev_create_ext(-1, SIGUSR1, 0); if (!scr->twin_ctx.fbdev) { - pb_log("%s: twin_fbdev_create_ext failed.\n", __func__); + pb_log_fn("twin_fbdev_create_ext failed.\n"); perror("failed to create twin fbdev context\n"); goto fail_ctx_create; } |