MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / close

Method close

engine/source/platformEmscripten/EmscriptenFileio.cpp:655–672  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Close the File. Returns the currentStatus -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

653// Returns the currentStatus
654//-----------------------------------------------------------------------------
655File::Status File::close()
656{
657 // if the handle is non-NULL, close it if necessary and free it
658 if (NULL != handle)
659 {
660 // make a local copy of the handle value and
661 // free the handle
662 int handleVal = *((int *)handle);
663 dRealFree(handle);
664 handle = (void *)NULL;
665
666 // close the handle if it is valid
667 if (handleVal != -1 && x86UNIXClose(handleVal) != 0)
668 return setStatus(); // unsuccessful
669 }
670 // Set the status to closed
671 return currentStatus = Closed;
672}
673
674//-----------------------------------------------------------------------------
675// Self-explanatory.

Callers 1

Calls 2

dRealFreeFunction · 0.70
x86UNIXCloseFunction · 0.70

Tested by

no test coverage detected