Skip to content

Commit

Permalink
Merge pull request #106 from Nieuwejaar/main
Browse files Browse the repository at this point in the history
Remove unsupported open_path_at() operation on illumos
  • Loading branch information
rbtcollins authored Sep 5, 2023
2 parents 5224c7c + cb5ac41 commit c82030d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "fs_at"
readme = "README.md"
repository = "https://github.com/rbtcollins/fs_at.git"
rust-version = "1.63.0"
version = "0.1.9"
version = "0.1.10"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
30 changes: 26 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,17 @@ impl OpenOptions {
/// Unix: sets O_NOFOLLOW | O_PATH. Many operations on the file handle are
/// restricted.
///
/// AIX, DragonFlyBSD, iOS, MacOSX, NetBSD, and OpenBSD: Not implemented as O_PATH is not defined.
#[cfg(not(any(target_os = "aix", target_os = "dragonfly", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))]
/// AIX, DragonFlyBSD, iOS, MacOSX, NetBSD, OpenBSD, and illumos: Not
/// implemented as O_PATH is not defined.
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "illumos"
)))]
pub fn open_path_at<P: AsRef<Path>>(&self, d: &File, p: P) -> Result<File> {
self._impl
.open_path_at(d, OpenOptions::ensure_rootless(p.as_ref())?)
Expand Down Expand Up @@ -521,7 +530,12 @@ pub mod testsupport;

#[cfg(test)]
mod tests {
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd")))]
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "netbsd",
target_os = "illumos"
)))]
use std::path::Path;
use std::{
ffi::OsStr,
Expand Down Expand Up @@ -1216,7 +1230,15 @@ mod tests {
Ok(())
}

#[cfg(not(any(target_os = "aix", target_os = "dragonfly", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))]
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "illumos"
)))]
#[test]
fn open_path_at() -> Result<()> {
let (_tmp, parent_dir, _pathname) = setup()?;
Expand Down
3 changes: 2 additions & 1 deletion src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ impl OpenOptionsImpl {
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
target_os = "openbsd",
target_os = "illumos"
)))]
pub fn open_path_at(&self, d: &File, path: &Path) -> Result<File> {
let flags =
Expand Down

0 comments on commit c82030d

Please sign in to comment.