]> Cypherpunks.ru repositories - goredo.git/blobdiff - targets.go
Fix some file descriptors closing
[goredo.git] / targets.go
index af4e4dae9326410a9d0754bcb7851e53f5605e30..334de9c847ee9520df24c93fb02bdf91dbcc44e2 100644 (file)
@@ -54,6 +54,7 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                                        return err
                                }
                                redoFis, err := redoDir.Readdir(0)
+                               redoDir.Close()
                                if err != nil {
                                        return err
                                }
@@ -64,7 +65,6 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                                                tgts[name[:len(name)-len(DepSuffix)]] = struct{}{}
                                        }
                                }
-                               redoDir.Close()
                        } else {
                                if err = targetsCollect(pth, tgts); err != nil {
                                        return err
@@ -72,7 +72,7 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                        }
                }
        }
-       return dir.Close()
+       return nil
 }
 
 func targetsWalker(tgts []string) ([]string, error) {