os: use FileMode instead of uint32 in various functions

Fixes #2733

R=chickencha, ality, rsc
CC=golang-dev
https://golang.org/cl/5553064
This commit is contained in:
Brad Fitzpatrick 2012-01-19 15:45:18 -08:00
parent ab2ea94c60
commit 6454a3eb15
8 changed files with 33 additions and 17 deletions

View file

@ -61,8 +61,8 @@ const DevNull = "/dev/null"
// (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 OpenFile(name string, flag int, perm uint32) (file *File, err error) {
r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, perm)
func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, syscallMode(perm))
if e != nil {
return nil, &PathError{"open", name, e}
}