Merge pull request #240 from agoode/flush

Call FlushVol on close()
This commit is contained in:
Wolfgang Thaller 2024-04-11 22:25:44 -06:00 committed by GitHub
commit 99de31d45a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 6 deletions

View File

@ -21,11 +21,11 @@
"multiversal": {
"flake": false,
"locked": {
"lastModified": 1703617805,
"narHash": "sha256-GngLWR9i+hC7hJ+ZkKlRK4K63lIJ4D/CMXZwefcVAqw=",
"lastModified": 1712682701,
"narHash": "sha256-/bHk7tU3+xxIs4YGLUyJVG9RsVO23ek41R//eO1F22Q=",
"owner": "autc04",
"repo": "multiversal",
"rev": "27c08c654bbd48d23f025741e3a584b59374904a",
"rev": "32dff28d1d618972cc2f544c86ee017b6464fa89",
"type": "github"
},
"original": {

View File

@ -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;
}

@ -1 +1 @@
Subproject commit 27c08c654bbd48d23f025741e3a584b59374904a
Subproject commit 32dff28d1d618972cc2f544c86ee017b6464fa89