]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #85490 - CDirkx:fix-vxworks, r=dtolnay
authorbors <bors@rust-lang.org>
Sun, 23 May 2021 05:40:18 +0000 (05:40 +0000)
committerbors <bors@rust-lang.org>
Sun, 23 May 2021 05:40:18 +0000 (05:40 +0000)
Fix `vxworks`

Some PRs made the `vxworks` target not build anymore. This PR fixes that:

- #82973: copy `ExitStatusError` implementation from `unix`.
- #84716: no `libc::chroot` available on `vxworks`, so for now don't implement `os::unix::fs::chroot`.

1  2 
library/std/src/sys/unix/fs.rs

index ef14865fbcd39dc174197f68b21a1cd26896fb2a,94ca3a6d71382898d4720847f5450dadba4f2dd4..f8ca67c844c91bac327797d454eaf7ab4b7ea603
@@@ -48,7 -48,7 +48,7 @@@ use libc::
      dirent64, fstat64, ftruncate64, lseek64, lstat64, off64_t, open64, readdir64_r, stat64,
  };
  
 -pub use crate::sys_common::fs::remove_dir_all;
 +pub use crate::sys_common::fs::{remove_dir_all, try_exists};
  
  pub struct File(FileDesc);
  
@@@ -1329,7 -1329,7 +1329,7 @@@ pub fn copy(from: &Path, to: &Path) -> 
      Ok(bytes_copied as u64)
  }
  
- #[cfg(not(target_os = "fuchsia"))]
+ #[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
  pub fn chroot(dir: &Path) -> io::Result<()> {
      let dir = cstr(dir)?;
      cvt(unsafe { libc::chroot(dir.as_ptr()) })?;