Commit 6b3e9553 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fix fsetattr_test.go.

parent d4e694da
...@@ -45,15 +45,15 @@ func (f *MutableDataFile) Release() { ...@@ -45,15 +45,15 @@ func (f *MutableDataFile) Release() {
} }
func (f *MutableDataFile) getAttr() *Attr { func (f *MutableDataFile) getAttr(out *Attr) {
a := f.Attr *out = f.Attr
a.Size = uint64(len(f.data)) out.Size = uint64(len(f.data))
return &a
} }
func (f *MutableDataFile) GetAttr() (*Attr, Status) { func (f *MutableDataFile) GetAttr(out *Attr) Status {
f.GetAttrCalled = true f.GetAttrCalled = true
return f.getAttr(), OK f.getAttr(out)
return OK
} }
func (f *MutableDataFile) Utimens(atimeNs int64, mtimeNs int64) Status { func (f *MutableDataFile) Utimens(atimeNs int64, mtimeNs int64) Status {
...@@ -93,9 +93,10 @@ func (fs *FSetAttrFs) GetAttr(name string, context *Context) (*Attr, Status) { ...@@ -93,9 +93,10 @@ func (fs *FSetAttrFs) GetAttr(name string, context *Context) (*Attr, Status) {
return &Attr{Mode: S_IFDIR | 0700}, OK return &Attr{Mode: S_IFDIR | 0700}, OK
} }
if name == "file" && fs.file != nil { if name == "file" && fs.file != nil {
a := fs.file.getAttr() var a Attr
fs.file.getAttr(&a)
a.Mode |= S_IFREG a.Mode |= S_IFREG
return a, OK return &a, OK
} }
return nil, ENOENT return nil, ENOENT
} }
......
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