/*
- * Copyright (C) 1997-2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
static struct fsck_args_info conf;
INIT_FSCK_ERRLISTS;
-INIT_STDERR_LOGGING(conf.loglevel_arg);
+
+static int loglevel;
+INIT_STDERR_LOGGING(loglevel);
/* taken from git */
signed char hexval_table[256] = {
static unsigned files_pruned;
-int prune_disk_storage_file(const char *path, const void *private_data)
+int prune_disk_storage_file(const char *path, void *private_data)
{
HASH_TYPE hash[HASH_SIZE];
unsigned flags = *(unsigned *)private_data;
PARA_INFO_LOG("looking for unreferenced disk storage files\n");
FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) {
char *dirname = column_filename(t, i);
- ret = for_each_file_in_dir(dirname, prune_disk_storage_file, &t->desc->flags);
+ ret = for_each_file_in_dir(dirname, prune_disk_storage_file,
+ (unsigned *)&t->desc->flags);
free(dirname);
}
if (files_pruned)
return ret;
}
+/**
+ * The praslash database check program.
+ *
+ * \param argc Usual arg count.
+ * \param argv Usual arg vector.
+ *
+ * \return \p EXIT_SUCCESS or \p EXIT_FAILURE.
+ */
int main(int argc, char **argv)
{
int i, ret;
goto out;
}
HANDLE_VERSION_FLAG("fsck", conf);
+ loglevel = get_loglevel_by_name(conf.loglevel_arg);
if (conf.base_dir_given)
base_dir = para_strdup(conf.base_dir_arg);
else {
PARA_ERROR_LOG("%s%s: %s\n",
base_dir? "base_dir: " : "",
base_dir? base_dir : "",
- PARA_STRERROR(-ret)
+ para_strerror(-ret)
);
- if (conf.loglevel_arg > 1)
- PARA_EMERG_LOG("re-run with \"--logelvel %d\" to increase verbosity\n",
- conf.loglevel_arg - 1);
} else
PARA_NOTICE_LOG("success\n");
if (base_dir)