Loading ifs_test/wr_test.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ int main(int argc, char* argv[]) { char *buffOut = new char[strlen(buffIn)]; int fd; int ret; struct stat st; fd = open((mountdir + "/nonexisting").c_str(), O_RDONLY); if(fd >= 0 ){ Loading @@ -36,6 +37,18 @@ int main(int argc, char* argv[]) { return -1; } /* Stat nonexisting file */ ret = stat(p.c_str(), &st); if(ret == 0){ cerr << "ERROR: succeeded on stating non-existing file" << endl; return -1; }; if(errno != ENOENT){ cerr << "ERROR: wrong error number while staing non-existing file: " << errno << endl; return -1; } /* Write the file */ fd = open(p.c_str(), O_WRONLY | O_CREAT, 0777); Loading @@ -55,8 +68,6 @@ int main(int argc, char* argv[]) { } /* Check file size */ struct stat st; ret = stat(p.c_str(), &st); if(ret != 0){ cerr << "Error stating file: " << strerror(errno) << endl; Loading Loading
ifs_test/wr_test.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ int main(int argc, char* argv[]) { char *buffOut = new char[strlen(buffIn)]; int fd; int ret; struct stat st; fd = open((mountdir + "/nonexisting").c_str(), O_RDONLY); if(fd >= 0 ){ Loading @@ -36,6 +37,18 @@ int main(int argc, char* argv[]) { return -1; } /* Stat nonexisting file */ ret = stat(p.c_str(), &st); if(ret == 0){ cerr << "ERROR: succeeded on stating non-existing file" << endl; return -1; }; if(errno != ENOENT){ cerr << "ERROR: wrong error number while staing non-existing file: " << errno << endl; return -1; } /* Write the file */ fd = open(p.c_str(), O_WRONLY | O_CREAT, 0777); Loading @@ -55,8 +68,6 @@ int main(int argc, char* argv[]) { } /* Check file size */ struct stat st; ret = stat(p.c_str(), &st); if(ret != 0){ cerr << "Error stating file: " << strerror(errno) << endl; Loading