Skip to content

Commit

Permalink
fix close before rename
Browse files Browse the repository at this point in the history
  • Loading branch information
konoui committed May 4, 2024
1 parent 9ffdea2 commit bc73461
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/lipo/fat_arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func (f fatArches) createFatBinary(path string, perm os.FileMode, cfg *lmacho.Fa
return err
}

// close before rename
if err := out.Close(); err != nil {
return err
}

// atomic operation
return os.Rename(out.Name(), path)
}
Expand Down

0 comments on commit bc73461

Please sign in to comment.