Commit 76c6deb5 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fixes for weekly 2012.01.27.

parent b6ea0fb7
...@@ -123,7 +123,7 @@ func (me *LoopbackFile) Truncate(size uint64) Status { ...@@ -123,7 +123,7 @@ func (me *LoopbackFile) Truncate(size uint64) Status {
// futimens missing from 6g runtime. // futimens missing from 6g runtime.
func (me *LoopbackFile) Chmod(mode uint32) Status { func (me *LoopbackFile) Chmod(mode uint32) Status {
return ToStatus(me.File.Chmod(mode)) return ToStatus(me.File.Chmod(os.FileMode(mode)))
} }
func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status { func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status {
......
...@@ -101,7 +101,7 @@ func (me *LoopbackFileSystem) Open(name string, flags uint32, context *Context) ...@@ -101,7 +101,7 @@ func (me *LoopbackFileSystem) Open(name string, flags uint32, context *Context)
} }
func (me *LoopbackFileSystem) Chmod(path string, mode uint32, context *Context) (code Status) { func (me *LoopbackFileSystem) Chmod(path string, mode uint32, context *Context) (code Status) {
err := os.Chmod(me.GetPath(path), mode) err := os.Chmod(me.GetPath(path), os.FileMode(mode))
return ToStatus(err) return ToStatus(err)
} }
...@@ -127,7 +127,7 @@ func (me *LoopbackFileSystem) Mknod(name string, mode uint32, dev uint32, contex ...@@ -127,7 +127,7 @@ func (me *LoopbackFileSystem) Mknod(name string, mode uint32, dev uint32, contex
} }
func (me *LoopbackFileSystem) Mkdir(path string, mode uint32, context *Context) (code Status) { func (me *LoopbackFileSystem) Mkdir(path string, mode uint32, context *Context) (code Status) {
return ToStatus(os.Mkdir(me.GetPath(path), mode)) return ToStatus(os.Mkdir(me.GetPath(path), os.FileMode(mode)))
} }
// Don't use os.Remove, it removes twice (unlink followed by rmdir). // Don't use os.Remove, it removes twice (unlink followed by rmdir).
...@@ -157,14 +157,14 @@ func (me *LoopbackFileSystem) Access(name string, mode uint32, context *Context) ...@@ -157,14 +157,14 @@ func (me *LoopbackFileSystem) Access(name string, mode uint32, context *Context)
} }
func (me *LoopbackFileSystem) Create(path string, flags uint32, mode uint32, context *Context) (fuseFile File, code Status) { func (me *LoopbackFileSystem) Create(path string, flags uint32, mode uint32, context *Context) (fuseFile File, code Status) {
f, err := os.OpenFile(me.GetPath(path), int(flags)|os.O_CREATE, mode) f, err := os.OpenFile(me.GetPath(path), int(flags)|os.O_CREATE, os.FileMode(mode))
return &LoopbackFile{File: f}, ToStatus(err) return &LoopbackFile{File: f}, ToStatus(err)
} }
func (me *LoopbackFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status) { func (me *LoopbackFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status) {
data := make([]byte, 1024) data := make([]byte, 1024)
data, errNo := GetXAttr(me.GetPath(name), attr, data) data, errNo := GetXAttr(me.GetPath(name), attr, data)
return data, Status(errNo) return data, Status(errNo)
} }
......
...@@ -141,7 +141,7 @@ func (me *testCase) TestReadThrough(t *testing.T) { ...@@ -141,7 +141,7 @@ func (me *testCase) TestReadThrough(t *testing.T) {
err := ioutil.WriteFile(ts.origFile, []byte(contents), 0700) err := ioutil.WriteFile(ts.origFile, []byte(contents), 0700)
CheckSuccess(err) CheckSuccess(err)
err = os.Chmod(ts.mountFile, mode) err = os.Chmod(ts.mountFile, os.FileMode(mode))
CheckSuccess(err) CheckSuccess(err)
fi, err := os.Lstat(ts.mountFile) fi, err := os.Lstat(ts.mountFile)
......
...@@ -32,7 +32,7 @@ func freezeRo(dir string) { ...@@ -32,7 +32,7 @@ func freezeRo(dir string) {
dir, dir,
func(path string, fi os.FileInfo, err error) error { func(path string, fi os.FileInfo, err error) error {
newMode := uint32(fi.Mode().Perm()) &^ 0222 newMode := uint32(fi.Mode().Perm()) &^ 0222
return os.Chmod(path, newMode) return os.Chmod(path, os.FileMode(newMode))
}) })
CheckSuccess(err) CheckSuccess(err)
} }
......
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