#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <getopt.h>
(void)client;
- pb_log("%s: TODO\n", __func__);
+ pb_debug("%s: TODO\n", __func__);
return 0;
}
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;
}
int result;
int ui_result;
struct pbt_client *client;
+ FILE *log;
result = pbt_opts_parse(&opts, argc, 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");
result += sigaction(SIGWINCH, &sa, NULL);
if (result) {
- pb_log("%s sigaction failed.\n", __func__);
+ pb_log_fn("sigaction failed.\n");
return EXIT_FAILURE;
}