aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/node/node_fs.zig4
-rw-r--r--src/bun.js/node/types.zig4
-rw-r--r--src/bun.js/rare_data.zig8
-rw-r--r--src/bun.js/test/snapshot.zig2
-rw-r--r--src/bun.js/webcore/blob.zig2
-rw-r--r--src/bun.js/webcore/streams.zig10
6 files changed, 15 insertions, 15 deletions
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig
index 01952dc68..2750bd1b8 100644
--- a/src/bun.js/node/node_fs.zig
+++ b/src/bun.js/node/node_fs.zig
@@ -14,7 +14,7 @@ const Flavor = JSC.Node.Flavor;
const system = std.os.system;
const Maybe = JSC.Maybe;
const Encoding = JSC.Node.Encoding;
-const Syscall = @import("./syscall.zig");
+const Syscall = bun.sys;
const Constants = @import("./node_fs_constant.zig").Constants;
const builtin = @import("builtin");
const os = @import("std").os;
@@ -30,7 +30,7 @@ const FileSystem = @import("../../fs.zig").FileSystem;
const StringOrBuffer = JSC.Node.StringOrBuffer;
const ArgumentsSlice = JSC.Node.ArgumentsSlice;
const TimeLike = JSC.Node.TimeLike;
-const Mode = JSC.Node.Mode;
+const Mode = bun.Mode;
const E = C.E;
const uid_t = if (Environment.isPosix) std.os.uid_t else i32;
const gid_t = if (Environment.isPosix) std.os.gid_t else i32;
diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig
index 51094d629..efd6d806b 100644
--- a/src/bun.js/node/types.zig
+++ b/src/bun.js/node/types.zig
@@ -8,7 +8,7 @@ const JSC = @import("root").bun.JSC;
const PathString = JSC.PathString;
const Environment = bun.Environment;
const C = bun.C;
-const Syscall = @import("./syscall.zig");
+const Syscall = bun.sys;
const os = std.os;
pub const Buffer = JSC.MarkedArrayBuffer;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
@@ -20,7 +20,7 @@ const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false;
const meta = bun.meta;
/// Time in seconds. Not nanos!
pub const TimeLike = c_int;
-pub const Mode = bun.C.Mode;
+const Mode = bun.Mode;
const heap_allocator = bun.default_allocator;
pub fn DeclEnum(comptime T: type) type {
const fieldInfos = std.meta.declarations(T);
diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig
index 30adeabe3..af2b90f3b 100644
--- a/src/bun.js/rare_data.zig
+++ b/src/bun.js/rare_data.zig
@@ -3,7 +3,7 @@ const Blob = JSC.WebCore.Blob;
const default_allocator = @import("root").bun.default_allocator;
const Output = @import("root").bun.Output;
const RareData = @This();
-const Syscall = @import("./node/syscall.zig");
+const Syscall = bun.sys;
const JSC = @import("root").bun.JSC;
const std = @import("std");
const BoringSSL = @import("root").bun.BoringSSL;
@@ -224,7 +224,7 @@ pub fn boringEngine(rare: *RareData) *BoringSSL.ENGINE {
pub fn stderr(rare: *RareData) *Blob.Store {
return rare.stderr_store orelse brk: {
var store = default_allocator.create(Blob.Store) catch unreachable;
- var mode: JSC.Node.Mode = 0;
+ var mode: bun.Mode = 0;
switch (Syscall.fstat(bun.STDERR_FD)) {
.result => |stat| {
mode = stat.mode;
@@ -254,7 +254,7 @@ pub fn stderr(rare: *RareData) *Blob.Store {
pub fn stdout(rare: *RareData) *Blob.Store {
return rare.stdout_store orelse brk: {
var store = default_allocator.create(Blob.Store) catch unreachable;
- var mode: JSC.Node.Mode = 0;
+ var mode: bun.Mode = 0;
switch (Syscall.fstat(bun.STDOUT_FD)) {
.result => |stat| {
mode = stat.mode;
@@ -282,7 +282,7 @@ pub fn stdout(rare: *RareData) *Blob.Store {
pub fn stdin(rare: *RareData) *Blob.Store {
return rare.stdin_store orelse brk: {
var store = default_allocator.create(Blob.Store) catch unreachable;
- var mode: JSC.Node.Mode = 0;
+ var mode: bun.Mode = 0;
switch (Syscall.fstat(bun.STDIN_FD)) {
.result => |stat| {
mode = stat.mode;
diff --git a/src/bun.js/test/snapshot.zig b/src/bun.js/test/snapshot.zig
index 072194b11..3e6afd4c9 100644
--- a/src/bun.js/test/snapshot.zig
+++ b/src/bun.js/test/snapshot.zig
@@ -247,7 +247,7 @@ pub const Snapshots = struct {
remain[0] = 0;
const snapshot_file_path = snapshot_file_path_buf[0 .. snapshot_file_path_buf.len - remain.len :0];
- var flags: JSC.Node.Mode = std.os.O.CREAT | std.os.O.RDWR;
+ var flags: bun.Mode = std.os.O.CREAT | std.os.O.RDWR;
if (this.update_snapshots) flags |= std.os.O.TRUNC;
const fd = switch (bun.sys.open(snapshot_file_path, flags, 0o644)) {
.result => |_fd| _fd,
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig
index f30a4a3d3..25f762e97 100644
--- a/src/bun.js/webcore/blob.zig
+++ b/src/bun.js/webcore/blob.zig
@@ -2635,7 +2635,7 @@ pub const Blob = struct {
pathlike: JSC.Node.PathOrFileDescriptor,
mime_type: HTTPClient.MimeType = HTTPClient.MimeType.other,
is_atty: ?bool = null,
- mode: JSC.Node.Mode = 0,
+ mode: bun.Mode = 0,
seekable: ?bool = null,
max_size: SizeType = Blob.max_size,
// milliseconds since ECMAScript epoch
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index 94f10925f..85783dbc3 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -356,7 +356,7 @@ pub const StreamStart = union(Tag) {
input_path: PathOrFileDescriptor,
truncate: bool = true,
close: bool = false,
- mode: JSC.Node.Mode = 0o664,
+ mode: bun.Mode = 0o664,
},
HTTPSResponseSink: void,
HTTPResponseSink: void,
@@ -1175,7 +1175,7 @@ pub const FileSink = struct {
auto_close: bool = false,
auto_truncate: bool = false,
fd: bun.FileDescriptor = bun.invalid_fd,
- mode: JSC.Node.Mode = 0,
+ mode: bun.Mode = 0,
chunk_size: usize = 0,
pending: StreamResult.Writable.Pending = StreamResult.Writable.Pending{
.result = .{ .done = {} },
@@ -1207,7 +1207,7 @@ pub const FileSink = struct {
}
const max_fifo_size = 64 * 1024;
- pub fn prepare(this: *FileSink, input_path: PathOrFileDescriptor, mode: JSC.Node.Mode) JSC.Node.Maybe(void) {
+ pub fn prepare(this: *FileSink, input_path: PathOrFileDescriptor, mode: bun.Mode) JSC.Node.Maybe(void) {
var file_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const auto_close = this.auto_close;
const fd = if (!auto_close)
@@ -4075,7 +4075,7 @@ pub const File = struct {
remaining_bytes: Blob.SizeType = std.math.maxInt(Blob.SizeType),
user_chunk_size: Blob.SizeType = 0,
total_read: Blob.SizeType = 0,
- mode: JSC.Node.Mode = 0,
+ mode: bun.Mode = 0,
pending: StreamResult.Pending = .{},
scheduled_count: u32 = 0,
@@ -4198,7 +4198,7 @@ pub const File = struct {
return .{ .err = Syscall.Error.fromCode(.INVAL, .fstat) };
}
- file.mode = @as(JSC.Node.Mode, @intCast(stat.mode));
+ file.mode = @as(bun.Mode, @intCast(stat.mode));
this.mode = file.mode;
this.seekable = bun.isRegularFile(stat.mode);