@@ -668,19 +668,9 @@ fn copyToFile(
668
668
in_fd : std.os.fd_t ,
669
669
dst_dir : Compilation.Directory ,
670
670
) ! []const u8 {
671
- // the section below is inspired by Compilation.tmpFilePath
672
- const new_name = blk : {
673
- const s = std .fs .path .sep_str ;
674
- const rand_int = std .crypto .random .int (u64 );
675
- if (dst_dir .path ) | p | {
676
- break :blk try std .fmt .allocPrint (arena , "{s}" ++ s ++ "tmp" ++ s ++ "{x}" , .{ p , rand_int });
677
- } else {
678
- break :blk try std .fmt .allocPrint (arena , "tmp" ++ s ++ "{x}" , .{rand_int });
679
- }
680
- };
671
+ const new_name = try dst_dir .tmpFilePath (arena , "waspipe" );
681
672
try dst_dir .handle .makePath ("tmp" );
682
-
683
- var outfile = try dst_dir .handle .createFile (new_name , std.fs.File.CreateFlags { .exclusive = true });
673
+ var outfile = try dst_dir .handle .createFile (new_name , .{});
684
674
defer outfile .close ();
685
675
errdefer dst_dir .handle .deleteFile (new_name ) catch {};
686
676
@@ -3967,7 +3957,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Translate
3967
3957
3968
3958
const c_src_basename = fs .path .basename (c_source_file .src_path );
3969
3959
const dep_basename = try std .fmt .allocPrint (arena , "{s}.d" , .{c_src_basename });
3970
- const out_dep_path = try comp .tmpFilePath (arena , dep_basename );
3960
+ const out_dep_path = try comp .local_cache_directory . tmpFilePath (arena , dep_basename );
3971
3961
break :blk out_dep_path ;
3972
3962
};
3973
3963
0 commit comments