Skip to content

Commit

Permalink
Open the file as write before trying to flush it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nabijaczleweli committed Mar 31, 2018
1 parent 3787106 commit e1d3c47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ fn exec_linker(sess: &Session, cmd: &mut Command, out_filename: &Path, tmpdir: &

if let &Ok(ref out) = command_output {
if out.status.success() {
if let Ok(of) = fs::File::open(out_filename) {
if let Ok(of) = fs::OpenOptions::new().write(true).open(out_filename) {
of.sync_all()?;
}
}
Expand Down

0 comments on commit e1d3c47

Please sign in to comment.