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

@ -25,7 +25,7 @@ const DevNull = "/dev/null"
// Open opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.)
// if applicable. If successful, methods on the returned File can be used for I/O.
// It returns the File and an Error, if any.
func Open(name string, flag int, perm int) (file *File, err Error) {
func Open(name string, flag int, perm uint32) (file *File, err Error) {
r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, perm)
if e != 0 {
return nil, &PathError{"open", name, Errno(e)}