Skip to content

Commit

Permalink
use backend->access in IOR source
Browse files Browse the repository at this point in the history
Signed-off-by: Julian M. Kunkel <[email protected]>
  • Loading branch information
shanedsnyder authored and JulianKunkel committed Jul 8, 2018
1 parent 8069e01 commit 0052bff
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,21 +1238,15 @@ static void RemoveFile(char *testFileName, int filePerProc, IOR_param_t * test)
rankOffset = 0;
GetTestFileName(testFileName, test);
}
if (access(testFileName, F_OK) == 0) {
if (backend->access(testFileName, F_OK, test) == 0) {
backend->delete(testFileName, test);
}
if (test->reorderTasksRandom == TRUE) {
rankOffset = tmpRankOffset;
GetTestFileName(testFileName, test);
}
} else {
// BUG: "access()" assumes a POSIX filesystem. Maybe use
// backend->get_file_size(), instead, (and catch
// errors), or extend the aiori struct to include
// something to safely check for existence of the
// "file".
//
if ((rank == 0) && (access(testFileName, F_OK) == 0)) {
if ((rank == 0) && (backend->access(testFileName, F_OK, test) == 0)) {
backend->delete(testFileName, test);
}
}
Expand Down

0 comments on commit 0052bff

Please sign in to comment.