mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 15:18:24 +00:00
Don't leak fd
This commit is contained in:
parent
ebec4fbc24
commit
e7f60161a3
@ -39,15 +39,7 @@ type Staggered struct {
|
|||||||
|
|
||||||
// Check if file or dir
|
// Check if file or dir
|
||||||
func isFile(path string) bool {
|
func isFile(path string) bool {
|
||||||
fileordir := path
|
fileInfo, err := os.Stat(path)
|
||||||
file, err := os.Open(fileordir)
|
|
||||||
if err != nil {
|
|
||||||
l.Infoln("versioner isFile:", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
fileInfo, err := file.Stat()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Infoln("versioner isFile:", err)
|
l.Infoln("versioner isFile:", err)
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user