MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / close

Method close

Engine/source/platformPOSIX/POSIXFileio.cpp:679–696  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

677// Returns the currentStatus
678//-----------------------------------------------------------------------------
679File::FileStatus File::close()
680{
681 // if the handle is non-NULL, close it if necessary and free it
682 if (NULL != handle)
683 {
684 // make a local copy of the handle value and
685 // free the handle
686 int handleVal = *((int *)handle);
687 dRealFree(handle);
688 handle = (void *)NULL;
689
690 // close the handle if it is valid
691 if (handleVal != -1 && x86UNIXClose(handleVal) != 0)
692 return setStatus(); // unsuccessful
693 }
694 // Set the status to closed
695 return currentStatus = Closed;
696}
697
698//-----------------------------------------------------------------------------
699// Self-explanatory.

Callers

nothing calls this directly

Calls 2

x86UNIXCloseFunction · 0.85
dRealFreeFunction · 0.70

Tested by

no test coverage detected