----------------------------------------------------------------------------- Close the File. Returns the currentStatus -----------------------------------------------------------------------------
| 653 | // Returns the currentStatus |
| 654 | //----------------------------------------------------------------------------- |
| 655 | File::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. |
no test coverage detected