This commit is contained in:
Kelvin Sherlock 2016-11-04 15:30:12 -04:00
parent 93bb259471
commit ec9e78c793
3 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -111,7 +111,7 @@ namespace OS { namespace Internal {
switch(ioPermission)
{
case fsWrPerm:
oflag = O_WRONLY;
oflag = O_RDWR;
break;
case fsRdWrPerm:
case fsRdWrShPerm:

View File

@ -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();