Merge pull request #349 from RichardScothern/348

Prevent Close() from being called after Finish()
This commit is contained in:
Stephen Day 2015-04-10 16:21:01 -07:00
commit 41dd70c901
2 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Andrey Kostov <kostov.andrey@gmail.com>
Andy Goldstein <agoldste@redhat.com> Andy Goldstein <agoldste@redhat.com>
Anton Tiurin <noxiouz@yandex.ru> Anton Tiurin <noxiouz@yandex.ru>
Arnaud Porterie <arnaud.porterie@docker.com> Arnaud Porterie <arnaud.porterie@docker.com>
Ben Firshman <ben@firshman.co.uk>
Brian Bland <brian.bland@docker.com> Brian Bland <brian.bland@docker.com>
David Lawrence <david.lawrence@docker.com> David Lawrence <david.lawrence@docker.com>
Derek McGowan <derek@mcgstyle.net> Derek McGowan <derek@mcgstyle.net>
@ -11,11 +12,13 @@ Diogo Mónica <diogo.monica@gmail.com>
Donald Huang <don.hcd@gmail.com> Donald Huang <don.hcd@gmail.com>
Frederick F. Kautz IV <fkautz@alumni.cmu.edu> Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
Josh Hawn <josh.hawn@docker.com> Josh Hawn <josh.hawn@docker.com>
Mary Anthony <mary@docker.com>
Nathan Sullivan <nathan@nightsys.net>
Nghia Tran <tcnghia@gmail.com> Nghia Tran <tcnghia@gmail.com>
Olivier Gambier <olivier@docker.com> Olivier Gambier <olivier@docker.com>
Richard <richard.scothern@gmail.com> Richard <richard.scothern@gmail.com>
Shreyas Karnik <karnik.shreyas@gmail.com> Shreyas Karnik <karnik.shreyas@gmail.com>
Simon Thulbourn <simon+github@thulbourn.com>
Stephen J Day <stephen.day@docker.com> Stephen J Day <stephen.day@docker.com>
Tianon Gravi <admwiggin@gmail.com> Tianon Gravi <admwiggin@gmail.com>
xiekeyang <xiekeyang@huawei.com> xiekeyang <xiekeyang@huawei.com>
Mary Anthony <mary.anthony@docker.com>

View File

@ -109,6 +109,10 @@ func (lw *layerWriter) ReadFrom(r io.Reader) (n int64, err error) {
} }
func (lw *layerWriter) Close() error { func (lw *layerWriter) Close() error {
if lw.err != nil {
return lw.err
}
if err := lw.storeHashState(); err != nil { if err := lw.storeHashState(); err != nil {
return err return err
} }