From b5faaf7116d1aec4812b752e45e7312a6a90a2c2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 18 Aug 2016 18:56:57 +0100 Subject: [PATCH] Fix double close of abort channel - fixes #592 --- fs/sync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/sync.go b/fs/sync.go index fe12afd9a..07de0d1ff 100644 --- a/fs/sync.go +++ b/fs/sync.go @@ -183,7 +183,9 @@ func (s *syncCopyMove) processError(err error) { defer s.errorMu.Unlock() switch { case IsFatalError(err): - close(s.abort) + if !s.aborting() { + close(s.abort) + } s.fatalErr = err case IsNoRetryError(err): s.noRetryErr = err