Skip to content

Commit efb5e91

Browse files

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

ext/node/ops/fs.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,21 @@ where
152152
let mut cpath = path.as_bytes().to_vec();
153153
cpath.push(0);
154154
if bigint {
155-
#[cfg(not(target_os = "macos"))]
155+
#[cfg(not(any(
156+
target_os = "macos",
157+
target_os = "freebsd",
158+
target_os = "openbsd"
159+
)))]
156160
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
157161
let (code, result) = unsafe {
158162
let mut result: libc::statfs64 = std::mem::zeroed();
159163
(libc::statfs64(cpath.as_ptr() as _, &mut result), result)
160164
};
161-
#[cfg(target_os = "macos")]
165+
#[cfg(any(
166+
target_os = "macos",
167+
target_os = "freebsd",
168+
target_os = "openbsd"
169+
))]
162170
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
163171
let (code, result) = unsafe {
164172
let mut result: libc::statfs = std::mem::zeroed();
@@ -168,7 +176,10 @@ where
168176
return Err(std::io::Error::last_os_error().into());
169177
}
170178
Ok(StatFs {
179+
#[cfg(not(target_os = "openbsd"))]
171180
typ: result.f_type as _,
181+
#[cfg(target_os = "openbsd")]
182+
typ: 0 as _,
172183
bsize: result.f_bsize as _,
173184
blocks: result.f_blocks as _,
174185
bfree: result.f_bfree as _,
@@ -186,7 +197,10 @@ where
186197
return Err(std::io::Error::last_os_error().into());
187198
}
188199
Ok(StatFs {
200+
#[cfg(not(target_os = "openbsd"))]
189201
typ: result.f_type as _,
202+
#[cfg(target_os = "openbsd")]
203+
typ: 0 as _,
190204
bsize: result.f_bsize as _,
191205
blocks: result.f_blocks as _,
192206
bfree: result.f_bfree as _,

0 commit comments

Comments
 (0)