Loading ifs/src/preload/intcp_functions.cpp +6 −8 Original line number Diff line number Diff line Loading @@ -82,10 +82,13 @@ int openat(int dirfd, const char *cpath, int flags, ...) { std::string resolved; if(cpath[0] != PSP) { if((cpath[0] == PSP) || (dirfd == AT_FDCWD)) { // cpath is absolute or relative to CWD if (CTX->relativize_path(cpath, resolved)) { return adafs_open(resolved, mode, flags); } } else { // cpath is relative //TODO handle the case in which dirfd is AT_FDCWD if(!(CTX->file_map()->exist(dirfd))) { //TODO relative cpath could still lead to our FS return LIBC_FUNC(openat, dirfd, cpath, flags, mode); Loading @@ -106,11 +109,6 @@ int openat(int dirfd, const char *cpath, int flags, ...) { if(resolve_path(path, resolved)) { return adafs_open(resolved, mode, flags); } } else { // Path is absolute if (CTX->relativize_path(cpath, resolved)) { return adafs_open(resolved, mode, flags); } } return LIBC_FUNC(openat, dirfd, resolved.c_str(), flags, mode); } Loading Loading
ifs/src/preload/intcp_functions.cpp +6 −8 Original line number Diff line number Diff line Loading @@ -82,10 +82,13 @@ int openat(int dirfd, const char *cpath, int flags, ...) { std::string resolved; if(cpath[0] != PSP) { if((cpath[0] == PSP) || (dirfd == AT_FDCWD)) { // cpath is absolute or relative to CWD if (CTX->relativize_path(cpath, resolved)) { return adafs_open(resolved, mode, flags); } } else { // cpath is relative //TODO handle the case in which dirfd is AT_FDCWD if(!(CTX->file_map()->exist(dirfd))) { //TODO relative cpath could still lead to our FS return LIBC_FUNC(openat, dirfd, cpath, flags, mode); Loading @@ -106,11 +109,6 @@ int openat(int dirfd, const char *cpath, int flags, ...) { if(resolve_path(path, resolved)) { return adafs_open(resolved, mode, flags); } } else { // Path is absolute if (CTX->relativize_path(cpath, resolved)) { return adafs_open(resolved, mode, flags); } } return LIBC_FUNC(openat, dirfd, resolved.c_str(), flags, mode); } Loading