diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index c53175b011..2f49f5e0ea 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -367,7 +367,10 @@ atSyscallPath(ThreadContext *tc, int dirfd, std::string &path) if (!ffdp) return -EBADF; - path = ffdp->getFileName() + "/" + path; + if (path.empty()) + path = ffdp->getFileName(); + else + path = ffdp->getFileName() + "/" + path; } return 0;