mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-24 17:29:38 +00:00
Call FlushVol on close()
This is recommended by Inside Macintosh.
This commit is contained in:
parent
05a3f397e1
commit
5157624174
@ -135,8 +135,14 @@ int _open_r(struct _reent *reent, const char* name, int flags, int mode)
|
||||
|
||||
int _close_r(struct _reent *reent, int fd)
|
||||
{
|
||||
if(fd >= kMacRefNumOffset)
|
||||
FSClose(fd - kMacRefNumOffset);
|
||||
if(fd >= kMacRefNumOffset) {
|
||||
short refNum = fd - kMacRefNumOffset;
|
||||
short vRefNum;
|
||||
OSErr err = GetVRefNum(refNum, &vRefNum);
|
||||
FSClose(refNum);
|
||||
if (err == noErr)
|
||||
FlushVol(NULL, vRefNum);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user