]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/ps3-main.c
Cleanup --dry-run option code
[petitboot] / ui / ncurses / ps3-main.c
index 890e47b852221a0c1b04e1519e838ac5a8bbb6e9..26d2591d467f7112fa63b7f351dde76f8d4224ba 100644 (file)
@@ -307,7 +307,7 @@ static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
        } else
                altered_args = 0;
 
-       result = pb_run_kexec(cod->kd);
+       result = pb_run_kexec(cod->kd, ps3->cui->dry_run);
 
        if (altered_args) {
                talloc_free(cod->kd->args);
@@ -597,7 +597,6 @@ int main(int argc, char *argv[])
        int result;
        int cui_result;
        unsigned int mode;
-       FILE *log;
 
        result = opts_parse(&opts, argc, argv);
 
@@ -616,9 +615,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);