mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
1badb46313
commit
e45b58fe96
21 changed files with 128 additions and 128 deletions
|
|
@ -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)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue