mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-12 10:31:01 +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)
|
int _close_r(struct _reent *reent, int fd)
|
||||||
{
|
{
|
||||||
if(fd >= kMacRefNumOffset)
|
if(fd >= kMacRefNumOffset) {
|
||||||
FSClose(fd - kMacRefNumOffset);
|
short refNum = fd - kMacRefNumOffset;
|
||||||
|
short vRefNum;
|
||||||
|
OSErr err = GetVRefNum(refNum, &vRefNum);
|
||||||
|
FSClose(refNum);
|
||||||
|
if (err == noErr)
|
||||||
|
FlushVol(NULL, vRefNum);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user