Commit 794d8cbe authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

UnionFs: insert all readdir entries directly into the channel.

parent c833c477
......@@ -65,7 +65,7 @@ type UnionFs struct {
roots []string
branches []*fuse.LoopbackFileSystem
// The same, but as interfaces.
fileSystems []fuse.FileSystem
......@@ -644,16 +644,14 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status
results[_READONLY] = 0, false
}
stream = make(chan fuse.DirEntry)
go func() {
for k, v := range results {
stream <- fuse.DirEntry{
Name: k,
Mode: v,
}
stream = make(chan fuse.DirEntry, len(results))
for k, v := range results {
stream <- fuse.DirEntry{
Name: k,
Mode: v,
}
close(stream)
}()
}
close(stream)
return stream, fuse.OK
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment