From 9ea8b6f659083ba94a8bb95d69b595fd6c330aaf Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sat, 25 Oct 2014 23:14:18 +0000 Subject: [PATCH] Do not delete temp files on error (fixes #849) --- internal/model/sharedpullerstate.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/model/sharedpullerstate.go b/internal/model/sharedpullerstate.go index eeb22a61c..9256e41cd 100644 --- a/internal/model/sharedpullerstate.go +++ b/internal/model/sharedpullerstate.go @@ -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 }