diff --git a/rpio.go b/rpio.go index ea3962b..3ff8997 100644 --- a/rpio.go +++ b/rpio.go @@ -705,9 +705,9 @@ func Open() (err error) { var file *os.File // Open fd for rw mem access; try dev/mem first (need root) - file, err = os.OpenFile("/dev/mem", os.O_RDWR|os.O_SYNC, 0) + file, err = os.OpenFile("/dev/mem", os.O_RDWR|os.O_SYNC, os.ModePerm) if os.IsPermission(err) { // try gpiomem otherwise (some extra functions like clock and pwm setting wont work) - file, err = os.OpenFile("/dev/gpiomem", os.O_RDWR|os.O_SYNC, 0) + file, err = os.OpenFile("/dev/gpiomem", os.O_RDWR|os.O_SYNC, os.ModePerm) } if err != nil { return