mirror of
https://github.com/octoleo/syncthing.git
synced 2024-09-19 21:29:01 +00:00
This commit is contained in:
parent
62a6d619e7
commit
31be810eb6
@ -280,13 +280,15 @@ func (s *sharedPullerState) finalClose() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s.fd != nil {
|
if s.fd != nil {
|
||||||
// This is our error if we weren't errored before. Otherwise we
|
if err := s.fd.Sync(); err != nil {
|
||||||
// keep the earlier error.
|
// Sync() is nice if it works but not worth failing the
|
||||||
if fsyncErr := s.fd.Sync(); fsyncErr != nil && s.err == nil {
|
// operation over if it fails.
|
||||||
s.err = fsyncErr
|
l.Debugf("fsync %q failed: %v", s.tempName, err)
|
||||||
}
|
}
|
||||||
if closeErr := s.fd.Close(); closeErr != nil && s.err == nil {
|
|
||||||
s.err = closeErr
|
if err := s.fd.Close(); err != nil && s.err == nil {
|
||||||
|
// This is our error as we weren't errored before.
|
||||||
|
s.err = err
|
||||||
}
|
}
|
||||||
s.fd = nil
|
s.fd = nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user