Set loglevel and use fsck_cmdline_parser_ext().
authorAndre Noll <maan@systemlinux.org>
Thu, 5 Jun 2008 22:32:38 +0000 (00:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 5 Jun 2008 22:32:38 +0000 (00:32 +0200)
fsck.c

diff --git a/fsck.c b/fsck.c
index f325e53..8e215e5 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1153,12 +1153,20 @@ int main(int argc, char **argv)
 {
        int i, ret;
        char *base_dir = NULL;
-
-       ret = fsck_cmdline_parser(argc, argv, &conf);
+       struct fsck_cmdline_parser_params params = {
+               .override = 0,
+               .initialize = 1,
+               .check_required = 1,
+               .check_ambiguity = 1,
+               .print_errors = 1
+       };
+       ret = fsck_cmdline_parser_ext(argc, argv, &conf, &params);
        if (ret < 0) {
+               loglevel = EMERG;
                ret = -E_FSCK_SYNTAX;
                goto out;
        }
+       loglevel = conf.loglevel_arg;
        HANDLE_VERSION_FLAG("fsck", conf);
        if (conf.base_dir_given)
                base_dir = para_strdup(conf.base_dir_arg);
@@ -1167,6 +1175,7 @@ int main(int argc, char **argv)
                base_dir = make_message("%s/.paraslash/afs_database", home);
                free(home);
        }
+       INFO_LOG("base_dir: %s\n", base_dir);
        if (!conf.inputs_num) {
                ret = check_all_tables(base_dir);
                goto out;