diff options
author | VlkrS <47375452+VlkrS@users.noreply.github.com> | 2023-06-12 12:14:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 13:14:27 +0300 |
commit | ea97af312f73f28d2a46b49a0cea570a90810e42 (patch) | |
tree | 60cf58e479470607a9244285779a6bb31cae3038 /ext/fs | |
parent | 7f15126f23d97f20a4fb33e43136cd4d13825863 (diff) |
feat: Adaptations to support OpenBSD port (#19153)
Diffstat (limited to 'ext/fs')
-rw-r--r-- | ext/fs/30_fs.js | 5 | ||||
-rw-r--r-- | ext/fs/std_fs.rs | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index f7c07f26a..a149f653d 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -244,7 +244,7 @@ function createByteStruct(types) { // types can be "date", "bool" or "u64". let offset = 0; let str = - 'const unix = Deno.build.os === "darwin" || Deno.build.os === "linux"; return {'; + 'const unix = Deno.build.os === "darwin" || Deno.build.os === "linux" || Deno.build.os === "openbsd" || Deno.build.os === "freebsd"; return {'; const typeEntries = ObjectEntries(types); for (let i = 0; i < typeEntries.length; ++i) { let { 0: name, 1: type } = typeEntries[i]; @@ -309,7 +309,8 @@ const { 0: statStruct, 1: statBuf } = createByteStruct({ }); function parseFileInfo(response) { - const unix = core.build.os === "darwin" || core.build.os === "linux"; + const unix = core.build.os === "darwin" || core.build.os === "linux" || + core.build.os === "freebsd" || core.build.os === "openbsd"; return { isFile: response.isFile, isDirectory: response.isDirectory, diff --git a/ext/fs/std_fs.rs b/ext/fs/std_fs.rs index 9baf74a2a..b2923abb1 100644 --- a/ext/fs/std_fs.rs +++ b/ext/fs/std_fs.rs @@ -66,7 +66,11 @@ impl FileSystem for RealFs { { Ok(r.bits()) } - #[cfg(target_os = "macos")] + #[cfg(any( + target_os = "macos", + target_os = "openbsd", + target_os = "freebsd" + ))] { Ok(r.bits() as u32) } |