diff --git a/check.sh b/check.sh index e2f438ae62..d62ef11833 100755 --- a/check.sh +++ b/check.sh @@ -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="" diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 916970379f..9338a97508 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -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);