syscall_emul: fix openat when directory does not end in "/"
authorCiro Santilli <ciro.santilli@arm.com>
Wed, 26 Sep 2018 16:11:07 +0000 (17:11 +0100)
committerCiro Santilli <ciro.santilli@gmail.com>
Tue, 30 Oct 2018 14:53:42 +0000 (14:53 +0000)
commit006eb36634a35f6b6d44ee63254f31ba96ac5267
treed85550e5860be8e7568eb4d222c6d631ee5cf359
parent8162e0da0285d346046151b2a45ceeb1baf63b8f
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 <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/13005
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
src/sim/syscall_emul.hh