From 8c811c4de9998d8f2872551dddeef4c036f6512d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 23 Dec 2014 11:30:07 -0500 Subject: [PATCH] revert previous open hack for PPCLink --- toolbox/os_internal.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/toolbox/os_internal.cpp b/toolbox/os_internal.cpp index 3e77ca1..af624eb 100644 --- a/toolbox/os_internal.cpp +++ b/toolbox/os_internal.cpp @@ -443,14 +443,10 @@ namespace OS { namespace Internal { if (filename.empty()) return MacOS::bdNamErr; int access = 0; - if (ioPermission != 0x33) ioPermission &= ~0x30; // drop deny read/write - switch(ioPermission) + + // ignore the deny bits for now. + switch(ioPermission & 0x0f) { - case 0x33: - // PBHOpenDeny exclusive access. - access = O_RDWR | O_CREAT; // | O_EXCL; - break; - case fsWrPerm: case fsRdWrPerm: case fsRdWrShPerm: @@ -471,7 +467,7 @@ namespace OS { namespace Internal { Log(" open(%s, %04x)\n", xname.c_str(), access); - fd = ::open(xname.c_str(), access, 0666); + fd = ::open(xname.c_str(), access); if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES) { fd = ::open(xname.c_str(), O_RDONLY);