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
This commit is contained in:
nabijaczleweli 2018-03-31 19:12:29 +02:00
parent 3787106be6
commit e1d3c471d7
No known key found for this signature in database
GPG key ID: BCFD0B018D2658F1

View file

@ -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()?;
}
}