Commit 90b39a3b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fake link counts so zipfs tests pass.

parent 58c4a412
......@@ -258,7 +258,7 @@ func (me *fsInode) GetAttr(file File, context *Context) (fi *os.FileInfo, code S
fi, code = me.fs.GetAttr(me.GetPath(), context)
}
if fi != nil && !fi.IsDirectory() {
if fi != nil && !fi.IsDirectory() && fi.Nlink == 0 {
fi.Nlink = 1
}
return fi, code
......
......@@ -40,21 +40,20 @@ type fileSystemMount struct {
openFiles HandleMap
}
func (me *fileSystemMount) setOwner(attr *Attr) {
if me.options.Owner != nil {
attr.Owner = *me.options.Owner
}
}
func (me *fileSystemMount) fileInfoToEntry(fi *os.FileInfo) (out *EntryOut) {
out = &EntryOut{}
SplitNs(me.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec)
SplitNs(me.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec)
CopyFileInfo(fi, &out.Attr)
me.setOwner(&out.Attr)
if !fi.IsDirectory() {
fi.Nlink = 1
if !fi.IsDirectory() && fi.Nlink == 0 {
out.Nlink = 1
}
return out
}
......
......@@ -71,7 +71,6 @@ func TestZipFs(t *testing.T) {
}
func TestLinkCount(t *testing.T) {
t.Log("TestLinkCount")
mp, clean := setupZipfs()
defer clean()
......
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