X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fncurses%2Fgeneric-main.c;h=9236a800beac18a11d1041037955687f109364c6;hp=6280a341987617a45c6d869beb0c935191a7944e;hb=63575c2045b1505da7a2abca8a51a4a7aa3df6f7;hpb=78c82fbd0a481249de1763b5d43bb9876ea612bd diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 6280a34..9236a80 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -18,11 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if defined(HAVE_CONFIG_H) #include "config.h" -#endif #define _GNU_SOURCE + +#include #include #include #include @@ -206,6 +206,7 @@ int main(int argc, char *argv[]) int result; int cui_result; struct opts opts; + FILE *log; result = opts_parse(&opts, argc, argv); @@ -224,20 +225,15 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } + log = stderr; if (strcmp(opts.log_file, "-")) { - FILE *log = fopen(opts.log_file, "a"); + log = fopen(opts.log_file, "a"); if (!log) log = fopen("/dev/null", "a"); + } - assert(log); - pb_log_set_stream(log); - } else - pb_log_set_stream(stderr); - -#if defined(DEBUG) - pb_log_always_flush(1); -#endif + pb_log_init(log); pb_log("--- petitboot-nc ---\n");