Skip to content

Commit

Permalink
hotfix for lease_test (issue #17). TODO: Check why stat is returning …
Browse files Browse the repository at this point in the history
…-errno instead of -1 on failure
  • Loading branch information
wreda committed Nov 19, 2021
1 parent 09dcda1 commit 82d228c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libfs/tests/lease_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void io_bench::checkdir(void){
dir_re = target_d_re + "/";
}

if(stat(dir.c_str(), &file_info) == -1) {
if(stat(dir.c_str(), &file_info) < 0) {
//cout << "dir not exists." << endl;
ret = mkdir(dir.c_str(), 0777);
if (ret < 0 && errno != EEXIST) {
Expand All @@ -197,7 +197,7 @@ void io_bench::checkdir(void){
}

if (test_mode == 'n') {
if(stat(dir_re.c_str(), &file_info) == -1){
if(stat(dir_re.c_str(), &file_info) < 0){
ret = mkdir(dir_re.c_str(), 0777);
if (ret < 0 && errno != EEXIST) {
perror("mkdir\n");
Expand Down

0 comments on commit 82d228c

Please sign in to comment.