};
static const char short_options[] = "hl:trV";
static const struct opts default_values = {
- .log_file = "pb-cui.log",
+ .log_file = "/var/log/petitboot/petitboot-nc.log",
};
*opts = default_values;
int result;
int cui_result;
unsigned int mode;
- FILE *log;
result = opts_parse(&opts, argc, argv);
return EXIT_SUCCESS;
}
- log = fopen(opts.log_file, "a");
- assert(log);
- pb_log_set_stream(log);
+ 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);