Split lyrics and image lines in stat output.
[paraslash.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index 4d71982..48fae27 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -176,7 +176,7 @@ static int map_index(const struct osl_table_description *desc, struct osl_object
        char *filename = index_filename(desc);
        int ret;
 
        char *filename = index_filename(desc);
        int ret;
 
-       ret = mmap_full_file(filename, O_RDWR, map);
+       ret = mmap_full_file(filename, O_RDWR, &map->data, &map->size, NULL);
        PARA_INFO_LOG("mapping index %s: ret: %d, size: %zu\n", filename, ret, map->size);
        free(filename);
        return ret;
        PARA_INFO_LOG("mapping index %s: ret: %d, size: %zu\n", filename, ret, map->size);
        free(filename);
        return ret;
@@ -758,7 +758,7 @@ static int dump_row(struct osl_table *t, unsigned row_num, const char *row_dir)
        ds_name = disk_storage_name_of_hash(t, hash);
        FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) {
                filename = disk_storage_path(t, i, ds_name);
        ds_name = disk_storage_name_of_hash(t, hash);
        FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) {
                filename = disk_storage_path(t, i, ds_name);
-               ret = mmap_full_file(filename, O_RDONLY, &obj);
+               ret = mmap_full_file(filename, O_RDONLY, &obj.data, &obj.size, NULL);
                free(filename);
                if (ret < 0)
                        goto out;
                free(filename);
                if (ret < 0)
                        goto out;
@@ -789,12 +789,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);
                        PARA_NOTICE_LOG("dumping rows %u - %u\n", i, i + 999);
                        ret = para_mkdir(current_dir, 0777);
                        current_dir = make_message("%s/rows_%u-%u", dump_dir, i, i + 999);
                        PARA_NOTICE_LOG("dumping rows %u - %u\n", i, i + 999);
                        ret = para_mkdir(current_dir, 0777);
-                       if (ret < 0 && ret != -E_EXIST)
+                       if (ret < 0 && !is_errno(-ret, EEXIST))
                                goto out;
                }
                row_dir = make_message("%s/row_%03u", current_dir, i);
                ret = para_mkdir(row_dir, 0777);
                                goto out;
                }
                row_dir = make_message("%s/row_%03u", current_dir, i);
                ret = para_mkdir(row_dir, 0777);
-               if (ret < 0 && ret != -E_EXIST) {
+               if (ret < 0 && !is_errno(-ret, EEXIST)) {
                        free(row_dir);
                        goto out;
                }
                        free(row_dir);
                        goto out;
                }
@@ -818,11 +818,11 @@ static int dump_table(char *dump_dir, struct osl_table_description *desc)
        if (ret < 0)
                goto out;
        ret = para_mkdir(dump_dir, 0777);
        if (ret < 0)
                goto out;
        ret = para_mkdir(dump_dir, 0777);
-       if (ret < 0 && ret != -E_EXIST)
+       if (ret < 0 && !is_errno(-ret, EEXIST))
                goto out;
        table_dump_dir = make_message("%s/%s", dump_dir, desc->name);
        ret = para_mkdir(table_dump_dir, 0777);
                goto out;
        table_dump_dir = make_message("%s/%s", dump_dir, desc->name);
        ret = para_mkdir(table_dump_dir, 0777);
-       if (ret < 0 && ret != -E_EXIST)
+       if (ret < 0 && !is_errno(-ret, EEXIST))
                goto out;
        desc_file = make_message("%s/table_description.c", table_dump_dir);
        ret = para_open(desc_file, O_WRONLY | O_CREAT | O_EXCL, 0644);
                goto out;
        desc_file = make_message("%s/table_description.c", table_dump_dir);
        ret = para_open(desc_file, O_WRONLY | O_CREAT | O_EXCL, 0644);