diff options
author | 2022-03-04 00:20:22 -0800 | |
---|---|---|
committer | 2022-03-04 00:20:22 -0800 | |
commit | 51fbbea1d3dc2b610fe5fe525229e56b581e5c8a (patch) | |
tree | c75e063c4eb7c99737fbf7a5a2014f9546e2e218 /src/cache.zig | |
parent | 696710fd7aedee6054947aab002aaa853e9ee731 (diff) | |
download | bun-jarred/upgrade-zig-2.tar.gz bun-jarred/upgrade-zig-2.tar.zst bun-jarred/upgrade-zig-2.zip |
upgrade zigjarred/upgrade-zig-2
Diffstat (limited to 'src/cache.zig')
-rw-r--r-- | src/cache.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cache.zig b/src/cache.zig index 25acce57a..fee17e30b 100644 --- a/src/cache.zig +++ b/src/cache.zig @@ -92,7 +92,7 @@ pub const Fs = struct { const file_handle: std.fs.File = if (_file_handle) |__file| std.fs.File{ .handle = __file } else - try std.fs.openFileAbsoluteZ(path, .{ .read = true }); + try std.fs.openFileAbsoluteZ(path, .{ .mode = .read_only }); defer { if (rfs.needToCloseFiles() and _file_handle == null) { @@ -127,10 +127,10 @@ pub const Fs = struct { if (_file_handle == null) { if (FeatureFlags.store_file_descriptors and dirname_fd > 0) { - file_handle = std.fs.Dir.openFile(std.fs.Dir{ .fd = dirname_fd }, std.fs.path.basename(path), .{ .read = true }) catch |err| brk: { + file_handle = std.fs.Dir.openFile(std.fs.Dir{ .fd = dirname_fd }, std.fs.path.basename(path), .{ .mode = .read_only }) catch |err| brk: { switch (err) { error.FileNotFound => { - const handle = try std.fs.openFileAbsolute(path, .{ .read = true }); + const handle = try std.fs.openFileAbsolute(path, .{ .mode = .read_only }); Output.prettyErrorln( "<r><d>Internal error: directory mismatch for directory \"{s}\", fd {d}<r>. You don't need to do anything, but this indicates a bug.", .{ path, dirname_fd }, @@ -141,7 +141,7 @@ pub const Fs = struct { } }; } else { - file_handle = try std.fs.openFileAbsolute(path, .{ .read = true }); + file_handle = try std.fs.openFileAbsolute(path, .{ .mode = .read_only }); } } |