X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Ftwin%2Fmain-generic.c;h=8ddec9ef2cd790044754196508114d08bf919e4b;hp=fcda70970bdce1e5b8e4ba0f54f06a65e5790a7f;hb=44ab15ff671fae26af2b5c8a5db8bcded677ef74;hpb=293fca73b2fe077e7780c1a42216a3db41a6e737 diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c index fcda709..8ddec9e 100644 --- a/ui/twin/main-generic.c +++ b/ui/twin/main-generic.c @@ -21,7 +21,6 @@ #include "config.h" #endif -#define _GNU_SOURCE #include #include #include @@ -58,7 +57,7 @@ static int edit_preferences_cb(struct pbt_item *item) (void)client; - pb_log("%s: TODO\n", __func__); + pb_debug("%s: TODO\n", __func__); return 0; } @@ -204,7 +203,7 @@ static int run(struct pbt_client *client) while (1) { int result = waiter_poll(client->waitset); - if (result < 0 && errno != EINTR) { + if (result < 0) { pb_log("%s: poll: %s\n", __func__, strerror(errno)); break; } @@ -268,6 +267,7 @@ int main(int argc, char *argv[]) int result; int ui_result; struct pbt_client *client; + FILE *log; result = pbt_opts_parse(&opts, argc, argv); @@ -286,17 +286,13 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } + log = stderr; if (strcmp(opts.log_file, "-")) { FILE *log = fopen(opts.log_file, "a"); - - assert(log); - pb_log_set_stream(log); - } else - pb_log_set_stream(stderr); - -#if defined(DEBUG) - pb_log_always_flush(1); -#endif + if (!log) + log = stderr; + } + pb_log_init(log); pb_log("--- petitboot-twin ---\n");