From f8b98893bc46e2615d994cccdadcff9edb91c7a4 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sat, 16 May 2015 22:57:58 +0100 Subject: [PATCH] Fix copy cmd when the host has only one CPU core --- cmd-copy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-copy.go b/cmd-copy.go index 99f8a39b..78b63755 100644 --- a/cmd-copy.go +++ b/cmd-copy.go @@ -110,7 +110,7 @@ func runCopyCmd(ctx *cli.Context) { } }(sourceURLs, targetURL) - var cpQueue = make(chan bool, runtime.NumCPU()-1) + var cpQueue = make(chan bool, intMax(runtime.NumCPU()-1, 1)) var wg sync.WaitGroup for cpURLs := range prepareCopyURLs(sourceURLs, targetURL) {