- Timestamp:
- 06/03/04 02:27:50 (21 years ago)
- File:
-
- 1 edited
-
ps/trunk/source/lib/res/file.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/lib/res/file.cpp
r373 r376 445 445 CHECK_FILE(f); 446 446 447 // make sure the mapping is actually freed, 448 // regardless of how many references remain. 449 if(f->map_refs > 1) 450 f->map_refs = 1; 451 file_unmap(f); 452 447 453 // (check fd to avoid BoundsChecker warning about invalid close() param) 448 454 if(f->fd != -1) … … 1345 1351 CHECK_FILE(f); 1346 1352 1353 // file is not currently mapped 1354 if(f->map_refs == 0) 1355 return -1; 1356 1357 // still more than one reference remaining - done. 1358 if(--f->map_refs > 0) 1359 return 0; 1360 1361 // no more references: remove the mapping 1347 1362 void* const p = f->mapping; 1348 1363 f->mapping = 0; 1349 // don't reset size - the file is still open. 1350 1351 // not currently mapped 1352 if(!p) 1353 return -1; 1354 1355 return munmap(p, (uint)f->size); 1356 } 1364 // don't clear f->size - the file is still open. 1365 1366 return munmap(p, f->size); 1367 }
Note:
See TracChangeset
for help on using the changeset viewer.
