Do not delete temp files on error (fixes #849)

This commit is contained in:
Audrius Butkevicius 2014-10-25 23:14:18 +00:00
parent 387f2f0a94
commit 9ea8b6f659

View File

@ -20,7 +20,6 @@ import (
"path/filepath"
"sync"
"github.com/syncthing/syncthing/internal/osutil"
"github.com/syncthing/syncthing/internal/protocol"
)
@ -137,8 +136,6 @@ func (s *sharedPullerState) earlyCloseLocked(context string, err error) {
s.err = err
if s.fd != nil {
s.fd.Close()
// Delete temporary file, even if parent dir is read-only
osutil.InWritableDir(func(string) error { os.Remove(s.tempName); return nil }, s.tempName)
}
s.closed = true
}