X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=fsck.c;h=bd1b5567ba86c05d2f168ecf9506c8dcda7ab5f7;hp=357fbe765846a503f0ab7e7b04d47e636048b317;hb=22abcc2013d2f68ec55e5e0113c682899662c7d7;hpb=7d53d2f571da94ec9caf85fb456118ebee85fcf9 diff --git a/fsck.c b/fsck.c index 357fbe7..bd1b556 100644 --- a/fsck.c +++ b/fsck.c @@ -14,7 +14,6 @@ #include "log.h" #include "osl.h" -#include "error.h" #include "util.h" #include "osl_core.h" #include "fsck.cmdline.h" @@ -44,6 +43,7 @@ static struct fsck_args_info conf; FSCK_ERROR(CHDIR, "could not change directory"), \ FSCK_ERROR(OPENDIR, "could not open directory"), +#define FSCK_ERROR_BIT 29 #define FSCK_ERROR(num, txt) E_FSCK_ ## num enum { FSCK_DUMMY = (1 << FSCK_ERROR_BIT) - 1, @@ -1062,12 +1062,12 @@ static int dump_rows(char *dump_dir, struct osl_table *t) current_dir = make_message("%s/rows_%u-%u", dump_dir, i, i + 999); NOTICE_LOG("dumping rows %u - %u\n", i, i + 999); ret = osl_mkdir(current_dir, 0777); - if (ret < 0 && !is_errno(-ret, EEXIST)) + if (ret < 0 && ret != -E_OSL_DIR_EXISTS) goto out; } row_dir = make_message("%s/row_%03u", current_dir, i); ret = osl_mkdir(row_dir, 0777); - if (ret < 0 && !is_errno(-ret, EEXIST)) { + if (ret < 0 && ret != -E_OSL_DIR_EXISTS) { free(row_dir); goto out; } @@ -1091,11 +1091,11 @@ static int dump_table(char *dump_dir, struct osl_table_description *desc) if (ret < 0) goto out; ret = osl_mkdir(dump_dir, 0777); - if (ret < 0 && !is_errno(-ret, EEXIST)) + if (ret < 0 && ret != -E_OSL_DIR_EXISTS) goto out; table_dump_dir = make_message("%s/%s", dump_dir, desc->name); ret = osl_mkdir(table_dump_dir, 0777); - if (ret < 0 && !is_errno(-ret, EEXIST)) + if (ret < 0 && ret != -E_OSL_DIR_EXISTS) goto out; desc_file = make_message("%s/table_description.c", table_dump_dir); ret = osl_open(desc_file, O_WRONLY | O_CREAT | O_EXCL, 0644);