SIGN IN SIGN UP

Pull: only close temporary file once

Close could be called twice on a temporary download file, which could
have bad side effects.

This fixes the problem by setting to ld.tmpFile to nil when the download
completes sucessfully. Then the call to ld.Close will have no effect,
and only the download manager will close the temporary file when it's
done extracting the layer from it. ld.Close will be responsible for
closing the file if we hit the retry limit and there is still a partial
download present.

Fixes #21675

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 930ae3dbcb11091955ca936c280d13f24494b245)
A
Aaron Lehmann committed
c5769cf53b9ad81cbd140e97be1ddaf95fe54ec7
Parent: b84d18e
Committed by Tibor Vass <tibor@docker.com> on 3/31/2016, 10:35:38 PM