ref: c0dcdeb75b90dff58aa614a73274790af19af4d0
parent: 6ae936b5ec488d9a555afdc2943654b31ff079ab
author: Ori Bernstein <[email protected]>
date: Sat Jun 7 18:19:16 EDT 2014
Fix bug in open()/openmode()
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -557,7 +557,7 @@
}
/* fd manipulation */
-const open = {path, opts; -> syscall(Sysopen, cstring(path), 0o644, mode) castto(fd)}
+const open = {path, opts; -> syscall(Sysopen, cstring(path), opts, 0o777) castto(fd)}
const openmode = {path, opts, mode; -> syscall(Sysopen, cstring(path), opts, mode) castto(fd)}
const close = {fd; -> syscall(Sysclose, fd)}
const creat = {path, mode; -> syscall(Syscreat, cstring(path), mode) castto(fd)}
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -593,7 +593,7 @@
/* fd manipulation */
-const open = {path, opts; -> syscall(Sysopen, cstring(path), opts, 0o644) castto(fd)}
+const open = {path, opts; -> syscall(Sysopen, cstring(path), opts, 0o777) castto(fd)}
const openmode = {path, opts, mode; -> syscall(Sysopen, cstring(path), opts, mode) castto(fd)}
const close = {fd; -> syscall(Sysclose, fd)}
const creat = {path, mode; -> openmode(path, Ocreat | Otrunc | Owronly, mode) castto(fd)}