mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +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)
|
warnln(err)
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
defer d.Close()
|
||||||
|
|
||||||
fis, err := d.Readdir(-1)
|
fis, err := d.Readdir(-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
warnln(err)
|
warnln(err)
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
d.Close()
|
|
||||||
for _, fi := range fis {
|
for _, fi := range fis {
|
||||||
if fi.Mode()&os.ModeSymlink != 0 {
|
if fi.Mode()&os.ModeSymlink != 0 {
|
||||||
err := filepath.Walk(path.Join(dir, fi.Name())+"/", fn)
|
err := filepath.Walk(path.Join(dir, fi.Name())+"/", fn)
|
||||||
|
Loading…
Reference in New Issue
Block a user