]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/generic-main.c
discover/grub2: Allow empty statements
[petitboot] / ui / ncurses / generic-main.c
index 560e3e5683e9b32b9ee9c965a4df01e32580a458..9236a800beac18a11d1041037955687f109364c6 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#if defined(HAVE_CONFIG_H)
 #include "config.h"
 #include "config.h"
-#endif
 
 #define _GNU_SOURCE
 
 #define _GNU_SOURCE
+
+#include <assert.h>
 #include <errno.h>
 #include <getopt.h>
 #include <signal.h>
 #include <errno.h>
 #include <getopt.h>
 #include <signal.h>
@@ -206,6 +206,7 @@ int main(int argc, char *argv[])
        int result;
        int cui_result;
        struct opts opts;
        int result;
        int cui_result;
        struct opts opts;
+       FILE *log;
 
        result = opts_parse(&opts, argc, argv);
 
 
        result = opts_parse(&opts, argc, argv);
 
@@ -224,20 +225,15 @@ int main(int argc, char *argv[])
                return EXIT_SUCCESS;
        }
 
                return EXIT_SUCCESS;
        }
 
+       log = stderr;
        if (strcmp(opts.log_file, "-")) {
        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");
 
                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");
 
 
        pb_log("--- petitboot-nc ---\n");
 
@@ -259,7 +255,6 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
 
        pb.mm = pb_mm_init(&pb);
                return EXIT_FAILURE;
 
        pb.mm = pb_mm_init(&pb);
-       ui_timer_disable(&pb.cui->timer);
 
        cui_result = cui_run(pb.cui, pb.mm, 0);
 
 
        cui_result = cui_run(pb.cui, pb.mm, 0);