From 00e05ae3c902836ce1151f4a2b45241ecb4ea120 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 27 Oct 2015 20:39:52 +0100 Subject: [PATCH] bugfix: close pack files after reading the header --- cmd/restic/cmd_rebuild_index.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go index bcce5d61f..3582079b1 100644 --- a/cmd/restic/cmd_rebuild_index.go +++ b/cmd/restic/cmd_rebuild_index.go @@ -165,6 +165,9 @@ func (cmd CmdRebuildIndex) RebuildIndex() error { combinedIndex.Store(blob.Type, blob.ID, packID, blob.Offset, blob.Length) } + err = rd.Close() + debug.Log("RebuildIndex.RebuildIndex", "error closing reader for pack %v: %v", packID.Str(), err) + if repository.IndexFull(combinedIndex) { combinedIndex, err = cmd.storeIndex(combinedIndex) if err != nil {