mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
Make sure to always close directory fd
This commit is contained in:
parent
ec0489a8ea
commit
71d50a50f4
4
walk.go
4
walk.go
@ -110,12 +110,14 @@ func Walk(dir string, model *Model, followSymlinks bool) []File {
|
||||
warnln(err)
|
||||
return files
|
||||
}
|
||||
defer d.Close()
|
||||
|
||||
fis, err := d.Readdir(-1)
|
||||
if err != nil {
|
||||
warnln(err)
|
||||
return files
|
||||
}
|
||||
d.Close()
|
||||
|
||||
for _, fi := range fis {
|
||||
if fi.Mode()&os.ModeSymlink != 0 {
|
||||
err := filepath.Walk(path.Join(dir, fi.Name())+"/", fn)
|
||||
|
Loading…
Reference in New Issue
Block a user