----------------------------------------------------------------------------- Close the File. Returns the currentStatus -----------------------------------------------------------------------------
| 677 | // Returns the currentStatus |
| 678 | //----------------------------------------------------------------------------- |
| 679 | File::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. |
nothing calls this directly
no test coverage detected