Skip to content

Commit 06971ea

Browse files
committed
Fix STD build failing for target_os = espidf
1 parent d127901 commit 06971ea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

library/std/src/sys/fs/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,16 @@ pub fn set_permissions(path: &Path, perm: FilePermissions) -> io::Result<()> {
117117
#[cfg(unix)]
118118
pub fn set_permissions_nofollow(path: &Path, perm: crate::fs::Permissions) -> io::Result<()> {
119119
use crate::fs::OpenOptions;
120-
use crate::os::unix::fs::OpenOptionsExt;
121120

122-
OpenOptions::new().custom_flags(libc::O_NOFOLLOW).open(path)?.set_permissions(perm)
121+
let mut options = OpenOptions::new();
122+
123+
#[cfg(not(target_os = "espidf"))]
124+
{
125+
use crate::os::unix::fs::OpenOptionsExt;
126+
options.custom_flags(libc::O_NOFOLLOW);
127+
}
128+
129+
options.open(path)?.set_permissions(perm)
123130
}
124131

125132
#[cfg(not(unix))]

0 commit comments

Comments
 (0)