From 1a3291cfa4e3a1efc50e2a9752bf6abc0e6ce02a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 19 Apr 2017 12:59:54 +0200 Subject: [PATCH] osl_open_table(): Remove pointless directory check. The subsequent mmap(2) call will fail if the directory does not exist (or if the path is not a directory), so this check is not needed. This removes the only user of the E_OSL_NOTDIR error code. We must keep it in the errlist file though, because error codes must be considered part of the API. --- osl.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/osl.c b/osl.c index c5f70ff..5f58488 100644 --- a/osl.c +++ b/osl.c @@ -1070,30 +1070,13 @@ int init_rbtrees(struct osl_table *t) __export int osl_open_table(const struct osl_table_description *table_desc, struct osl_table **result) { - int i, ret; + int ret; struct osl_table *t; - const struct osl_column_description *cd; NOTICE_LOG("opening table %s\n", table_desc->name); ret = init_table_structure(table_desc, &t); if (ret < 0) return ret; - FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) { - struct stat statbuf; - char *dirname = column_filename(t, i); - - ret = -E_OSL_NOMEM; - if (!dirname) - goto err; - /* check if directory exists */ - ret = osl_stat(dirname, &statbuf); - free(dirname); - if (ret < 0) - goto err; - ret = -E_OSL_NOTDIR; - if (!S_ISDIR(statbuf.st_mode)) - goto err; - } ret = map_table(t, MAP_TBL_FL_VERIFY_INDEX); if (ret < 0) goto err; -- 2.39.5