From e6bd9ad3b31acf04372b1d442a753260caacfac8 Mon Sep 17 00:00:00 2001 From: Sylvain Didelot Date: Tue, 9 Oct 2018 12:14:30 +0200 Subject: [PATCH] common: call mkdir/access syscalls defined in backends mkdir/access syscalls used in PrependDir() should call their equivalent implemented by the backend. --- src/ior.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ior.c b/src/ior.c index 66cca76..bf5faa7 100755 --- a/src/ior.c +++ b/src/ior.c @@ -823,14 +823,15 @@ static char *PrependDir(IOR_param_t * test, char *rootDir) sprintf(dir, "%s%d", dir, (rank + rankOffset) % test->numTasks); /* dir doesn't exist, so create */ - if (access(dir, F_OK) != 0) { - if (mkdir(dir, S_IRWXU) < 0) { + if (backend->access(dir, F_OK, test) != 0) { + if (backend->mkdir(dir, S_IRWXU, test) < 0) { ERR("cannot create directory"); } /* check if correct permissions */ - } else if (access(dir, R_OK) != 0 || access(dir, W_OK) != 0 || - access(dir, X_OK) != 0) { + } else if (backend->access(dir, R_OK, test) != 0 || + backend->access(dir, W_OK, test) != 0 || + backend->access(dir, X_OK, test) != 0) { ERR("invalid directory permissions"); }