Skip to content

Commit e1d3c47

Browse files
Open the file as write before trying to flush it
This should be enough and shouldn't require append(true) since we're not explicitly writing anything so we're not flushing it so we've no risk of overwriting it
1 parent 3787106 commit e1d3c47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_trans/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ fn exec_linker(sess: &Session, cmd: &mut Command, out_filename: &Path, tmpdir: &
894894

895895
if let &Ok(ref out) = command_output {
896896
if out.status.success() {
897-
if let Ok(of) = fs::File::open(out_filename) {
897+
if let Ok(of) = fs::OpenOptions::new().write(true).open(out_filename) {
898898
of.sync_all()?;
899899
}
900900
}

0 commit comments

Comments
 (0)