mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 12:55:18 +00:00
internal/restic: close os.File after checking for error
This commit is contained in:
parent
a307797c11
commit
4a2156d3f0
@ -13,10 +13,10 @@ import (
|
||||
|
||||
func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespec) error {
|
||||
dir, err := fs.Open(filepath.Dir(path))
|
||||
defer dir.Close()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Open")
|
||||
}
|
||||
defer dir.Close()
|
||||
|
||||
times := []unix.Timespec{
|
||||
{Sec: utimes[0].Sec, Nsec: utimes[0].Nsec},
|
||||
|
Loading…
Reference in New Issue
Block a user