]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/generic-main.c
Fix device mount retry
[petitboot] / ui / ncurses / generic-main.c
index 6b8f5bacd92eb95c155727904d6bea5c7a910d8d..4d154eee067502cff1d93a4ee6ba44bc2cde31e1 100644 (file)
@@ -234,7 +234,6 @@ int main(int argc, char *argv[])
        static struct opts opts;
        int result;
        int cui_result;
-       FILE *log;
 
        result = opts_parse(&opts, argc, argv);
 
@@ -253,9 +252,13 @@ int main(int argc, char *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);