Skip to content

Commit 2f867fa

Browse files
authored
cli: fix macos build (microsoft#185401)
1 parent a4d4857 commit 2f867fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli/src/util/zipper.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ where
8888
use std::io::Read;
8989
use std::os::unix::ffi::OsStringExt;
9090

91-
if matches!(file.unix_mode(), Some(mode) if mode & S_IFLNK == S_IFLNK) {
91+
#[cfg(target_os = "macos")]
92+
const S_IFLINK_32: u32 = S_IFLNK as u32;
93+
94+
#[cfg(target_os = "linux")]
95+
const S_IFLINK_32: u32 = S_IFLNK;
96+
97+
if matches!(file.unix_mode(), Some(mode) if mode & S_IFLINK_32 == S_IFLINK_32) {
9298
let mut link_to = Vec::new();
9399
file.read_to_end(&mut link_to).map_err(|e| {
94100
wrap(

0 commit comments

Comments
 (0)