Ciro Santilli has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/13005 )
Change subject: syscall_emul: fix openat when directory does not end in "/"
......................................................................
syscall_emul: fix openat when directory does not end in "/"
Before this commit, the following code:
dir_fd = open(".", O_DIRECTORY);
file_fd = openat(dir_fd, "ble", O_CREAT, S_IRUSR | S_IWUSR);
would create a file called ".ble" in the current working directory,
instead of the correct "ble".
Change-Id: I1525a088d49744e29b760387afabef9f1ac98646
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/13005
Reviewed-by: Brandon Potter <[email protected]>
Maintainer: Brandon Potter <[email protected]>
---
M src/sim/syscall_emul.hh
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Andreas Sandberg: Looks good to me, approved
Brandon Potter: Looks good to me, approved; Looks good to me, approved
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index c7818b6..17d4109 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -695,7 +695,7 @@
auto ffdp = std::dynamic_pointer_cast<FileFDEntry>(fdep);
if (!ffdp)
return -EBADF;
- path.insert(0, ffdp->getFileName());
+ path.insert(0, ffdp->getFileName() + "/");
}
/**
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13005
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1525a088d49744e29b760387afabef9f1ac98646
Gerrit-Change-Number: 13005
Gerrit-PatchSet: 3
Gerrit-Owner: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Brandon Potter <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev