Merge pull request #41 from stephen679/fix_too_many_files_open
[bug fix] tar: explicitly close files after populateTree
This commit is contained in:
commit
39f68f5be2
1 changed files with 2 additions and 3 deletions
5
tar.go
5
tar.go
|
@ -93,9 +93,6 @@ func (ts *tarStream) readHeaders() {
|
||||||
ts.pipeReader.CloseWithError(err)
|
ts.pipeReader.CloseWithError(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer tmpFile.Close()
|
|
||||||
defer os.Remove(tmpFile.Name())
|
|
||||||
|
|
||||||
// Alright, it's either file or directory
|
// Alright, it's either file or directory
|
||||||
encodedName, err := Vis(filepath.Base(hdr.Name))
|
encodedName, err := Vis(filepath.Base(hdr.Name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -175,6 +172,8 @@ func (ts *tarStream) readHeaders() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
populateTree(&root, &e, hdr, ts)
|
populateTree(&root, &e, hdr, ts)
|
||||||
|
tmpFile.Close()
|
||||||
|
os.Remove(tmpFile.Name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue