mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 10:25:13 +00:00
std.fs.Dir: fix updateFile() to flush the file before updating its times
AtomicFile.finish() calls flush() which renders any previous updateTimes() calls useless. Regression introduced in f2a3ac7c0534a74ee544fdf6ef9d2176a8d62389. Closes #24927.
This commit is contained in:
parent
47a2f2ddae
commit
77c09d16f9
@ -2583,8 +2583,9 @@ pub fn updateFile(
|
||||
error.ReadFailed => return src_reader.err.?,
|
||||
error.WriteFailed => return atomic_file.file_writer.err.?,
|
||||
};
|
||||
try atomic_file.flush();
|
||||
try atomic_file.file_writer.file.updateTimes(src_stat.atime, src_stat.mtime);
|
||||
try atomic_file.finish();
|
||||
try atomic_file.renameIntoPlace();
|
||||
return .stale;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user