os: change the type of permissions argument for Open etc. to uint32.

Besides being more correct, it protects against people accidentally
exchanging the permission and open mode arguments to Open.

R=rsc
CC=golang-dev
https://golang.org/cl/1904045
This commit is contained in:
Rob Pike 2010-08-04 08:34:52 +10:00
parent 1badb46313
commit e45b58fe96
21 changed files with 128 additions and 128 deletions

View file

@ -153,7 +153,7 @@ func main() {
changed[o.Dst] = 1
}
if o.Mode != 0 {
chk(os.Chmod(o.Dst, o.Mode&0755))
chk(os.Chmod(o.Dst, uint32(o.Mode&0755)))
undoRevert(o.Dst)
changed[o.Dst] = 1
}
@ -192,7 +192,7 @@ func makeParent(name string) {
// Copy of os.MkdirAll but adds to undo log after
// creating a directory.
func mkdirAll(path string, perm int) os.Error {
func mkdirAll(path string, perm uint32) os.Error {
dir, err := os.Lstat(path)
if err == nil {
if dir.IsDirectory() {