diff options
-rw-r--r-- | src/bundler.zig | 2 | ||||
-rw-r--r-- | src/fs.zig | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/bundler.zig b/src/bundler.zig index 89c37e9ab..2ca075760 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -700,7 +700,7 @@ pub const Bundler = struct { const tmpname = try bundler.fs.tmpname( ".bun", std.mem.span(&tmpname_buf), - std.hash.Wyhash.hash(0, std.mem.span(destination)), + std.hash.Wyhash.hash(@intCast(usize, std.time.milliTimestamp()) % std.math.maxInt(u32), std.mem.span(destination)), ); var tmpfile = Fs.FileSystem.RealFS.Tmpfile{}; diff --git a/src/fs.zig b/src/fs.zig index 75d01149d..0b28fa9b7 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -534,12 +534,11 @@ pub const FileSystem = struct { } pub fn create(this: *Tmpfile, rfs: *RealFS, name: [*:0]const u8) !void { - var tmpdir_ = if (Environment.isLinux) try rfs.openDir(rfs.parent_fs.top_level_dir) else try rfs.openTmpDir(); + var tmpdir_ = try rfs.openTmpDir(); - const default_flags = std.os.O_CREAT | std.os.O_RDWR | std.os.O_CLOEXEC; - const flags = if (Environment.isLinux) default_flags | std.os.O_TMPFILE else default_flags | std.os.O_EXCL; + const flags = std.os.O_CREAT | std.os.O_RDWR | std.os.O_CLOEXEC; this.dir_fd = tmpdir_.fd; - this.fd = try std.os.openatZ(tmpdir_.fd, name, flags, 0666); + this.fd = try std.os.openatZ(tmpdir_.fd, name, flags, std.os.S_IRWXO); } pub fn promote(this: *Tmpfile, from_name: [*:0]const u8, destination_fd: std.os.fd_t, name: [*:0]const u8) !void { |