Fixing hang in archive.CopyWithTar with invalid dst

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
Stefan J. Wernli 2015-10-14 16:25:03 -07:00
parent 831c2e7a7b
commit f05813a1ea
2 changed files with 27 additions and 1 deletions

View file

@ -910,7 +910,11 @@ func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
}
}()
return archiver.Untar(r, filepath.Dir(dst), nil)
err = archiver.Untar(r, filepath.Dir(dst), nil)
if err != nil {
r.CloseWithError(err)
}
return err
}
// CopyFileWithTar emulates the behavior of the 'cp' command-line