From ec9e78c79397f1df15338426672991ab8a453079 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 4 Nov 2016 15:30:12 -0400 Subject: [PATCH] updates. --- toolbox/os.cpp | 2 ++ toolbox/os_internal.cpp | 2 +- toolbox/rm-new.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toolbox/os.cpp b/toolbox/os.cpp index 2ea898c..b37508e 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -260,6 +260,8 @@ namespace OS sname = FSSpecManager::ExpandPath(sname, ioDirID); } + Log(" open(%s, %02x, %02x)\n", sname.c_str(), resource, ioPermission); + auto fd = Internal::open_file(sname, resource, ioPermission); if (fd) memoryWriteWord(fd.value(), parm + _ioRefNum); d0 = fd.error(); diff --git a/toolbox/os_internal.cpp b/toolbox/os_internal.cpp index f0bd8a8..da85775 100644 --- a/toolbox/os_internal.cpp +++ b/toolbox/os_internal.cpp @@ -111,7 +111,7 @@ namespace OS { namespace Internal { switch(ioPermission) { case fsWrPerm: - oflag = O_WRONLY; + oflag = O_RDWR; break; case fsRdWrPerm: case fsRdWrShPerm: diff --git a/toolbox/rm-new.cpp b/toolbox/rm-new.cpp index e805f13..ad74377 100644 --- a/toolbox/rm-new.cpp +++ b/toolbox/rm-new.cpp @@ -840,12 +840,12 @@ namespace Native { macos_error err = noErr; - auto fd = native::open_fork(path, 0, O_CREAT | O_EXCL | O_WRONLY, 0666); + auto fd = native::open_fork(path, 0, O_CREAT | O_EXCL | O_WRONLY); if ((err = fd.error())) { if (err != dupFNErr) return SetResError(err); } - fd = native::open_fork(path, 1, O_WRONLY, 0666); + fd = native::open_fork(path, 1, O_WRONLY); if (fd.error()) return SetResError(macos_error_from_errno()); auto ff = std::move(fd).value();