! Close an open file * * @param[in,out] r newlib reentrancy struct * @param[in] fd Pointer to archive_file_t * * @returns 0 for success * @returns -1 for error */
| 595 | * @returns -1 for error |
| 596 | */ |
| 597 | static int |
| 598 | archive_close(struct _reent *r, |
| 599 | void *fd) |
| 600 | { |
| 601 | Result rc; |
| 602 | |
| 603 | /* get pointer to our data */ |
| 604 | archive_file_t *file = (archive_file_t*)fd; |
| 605 | |
| 606 | rc = FSFILE_Close(file->fd); |
| 607 | if(R_SUCCEEDED(rc)) |
| 608 | return 0; |
| 609 | |
| 610 | r->_errno = archive_translate_error(rc); |
| 611 | return -1; |
| 612 | } |
| 613 | |
| 614 | /*! Write to an open file |
| 615 | * |
nothing calls this directly
no test coverage detected