Fix statat tests
This commit is contained in:
@@ -98,7 +98,7 @@ run_redoxer() {
|
||||
redoxer toolchain || { echo -e "${RED}Fail: redoxer toolchain for: $target.${NC}" && exit 1; }
|
||||
export CARGOFLAGS=""
|
||||
export CARGO_TEST="redoxer"
|
||||
export TEST_RUNNER="redoxer exec --folder ../sysroot/$TARGET:/usr --folder . --"
|
||||
export TEST_RUNNER="redoxer exec --folder ../sysroot/$TARGET/:/usr --folder . --"
|
||||
MAKE_ACTION="$MAKE_ACTION IS_REDOX=1"
|
||||
else
|
||||
REDOXER_ENV=""
|
||||
|
||||
@@ -352,12 +352,13 @@ impl Pal for Sys {
|
||||
// FIXME: Ideally we would want the file descriptor to not leak on fork(2) too because
|
||||
// fstatat(2) should not have side effects. However, Redox does not currently support that,
|
||||
// so we use `CLOEXEC` as a compromise.
|
||||
// FIXME: Should we handle AT_* flags here or in openat2?
|
||||
let mut open_flags = fcntl::O_PATH | fcntl::O_CLOEXEC;
|
||||
if flags & AT_SYMLINK_NOFOLLOW == AT_SYMLINK_NOFOLLOW {
|
||||
open_flags |= fcntl::O_NOFOLLOW;
|
||||
open_flags |= fcntl::O_SYMLINK | fcntl::O_NOFOLLOW;
|
||||
}
|
||||
|
||||
let file = openat2(dirfd, path, open_flags, 0)?;
|
||||
let file = openat2(dirfd, path, 0, open_flags)?;
|
||||
// Close the file descriptor after fstat(2) regardless of success or failure.
|
||||
let fstat_res = Sys::fstat(*file, buf);
|
||||
let close_res = syscall::close(file.fd as usize);
|
||||
|
||||
Reference in New Issue
Block a user