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

UnionFs: insert all readdir entries directly into the channel.

parent c833c477
...@@ -644,8 +644,7 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status ...@@ -644,8 +644,7 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status
results[_READONLY] = 0, false results[_READONLY] = 0, false
} }
stream = make(chan fuse.DirEntry) stream = make(chan fuse.DirEntry, len(results))
go func() {
for k, v := range results { for k, v := range results {
stream <- fuse.DirEntry{ stream <- fuse.DirEntry{
Name: k, Name: k,
...@@ -653,7 +652,6 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status ...@@ -653,7 +652,6 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status
} }
} }
close(stream) close(stream)
}()
return stream, fuse.OK 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