mirror of
https://github.com/oven-sh/bun
synced 2026-02-19 07:12:24 +00:00
re-add iov in file so PipeReader compile
This commit is contained in:
@@ -13,6 +13,7 @@ pub const Source = union(enum) {
|
||||
const Tty = uv.uv_tty_t;
|
||||
const File = struct {
|
||||
fs: uv.fs_t,
|
||||
iov: uv.uv_buf_t,
|
||||
file: uv.uv_file,
|
||||
};
|
||||
|
||||
@@ -79,22 +80,6 @@ pub const Source = union(enum) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn isClosed(this: Source) bool {
|
||||
switch (this) {
|
||||
.pipe => |pipe| return pipe.isClosed(),
|
||||
.tty => |tty| return tty.isClosed(),
|
||||
.file => |file| return file.file == -1,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn isActive(this: Source) bool {
|
||||
switch (this) {
|
||||
.pipe => |pipe| return pipe.isActive(),
|
||||
.tty => |tty| return tty.isActive(),
|
||||
.file => return false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn openPipe(loop: *uv.Loop, fd: bun.FileDescriptor, ipc: bool) bun.JSC.Maybe(*Source.Pipe) {
|
||||
log("openPipe (fd = {})", .{fd});
|
||||
const pipe = bun.default_allocator.create(Source.Pipe) catch bun.outOfMemory();
|
||||
|
||||
Reference in New Issue
Block a user