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 {
// futimens missing from 6g runtime.
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 {
......
......@@ -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) {
err := os.Chmod(me.GetPath(path), mode)
err := os.Chmod(me.GetPath(path), os.FileMode(mode))
return ToStatus(err)
}
......@@ -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) {
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).
......@@ -157,7 +157,7 @@ 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) {
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)
}
......
......@@ -141,7 +141,7 @@ func (me *testCase) TestReadThrough(t *testing.T) {
err := ioutil.WriteFile(ts.origFile, []byte(contents), 0700)
CheckSuccess(err)
err = os.Chmod(ts.mountFile, mode)
err = os.Chmod(ts.mountFile, os.FileMode(mode))
CheckSuccess(err)
fi, err := os.Lstat(ts.mountFile)
......
......@@ -32,7 +32,7 @@ func freezeRo(dir string) {
dir,
func(path string, fi os.FileInfo, err error) error {
newMode := uint32(fi.Mode().Perm()) &^ 0222
return os.Chmod(path, newMode)
return os.Chmod(path, os.FileMode(newMode))
})
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