Skip to content

Commit 85d76af

Browse files
Fixed file loss when power off inconshreveable#44
1 parent 0e8a5a3 commit 85d76af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apply.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func Apply(update io.Reader, opts Options) error {
118118
if err != nil {
119119
return err
120120
}
121-
121+
//don't call fp.Sync(). system power off ,file will lost
122+
fp.Sync()
122123
// if we don't call fp.Close(), windows won't let us move the new executable
123124
// because the file will still be "in use"
124125
fp.Close()

0 commit comments

Comments
 (0)