void file::close() { if( (HANDLE)this->handle_ != INVALID_HANDLE_VALUE ) { if( close_nothrow((HANDLE)this->handle_) == -1 ) { throw_get_last_error("close failed"); } } release(); }
file::~file() { if( (HANDLE)this->handle_ != INVALID_HANDLE_VALUE ) { if( close_nothrow((HANDLE)this->handle_) == -1 ) { // TODO: add silent failures reporting // int err = get_last_error(); // tinfra::silent_failure(fmt("file close failed: %i" % blabla ) } release(); } }
int rpl_close (int fd) { #if WINDOWS_SOCKETS int retval = execute_all_close_hooks (close_nothrow, fd); #else int retval = close_nothrow (fd); #endif #if REPLACE_FCHDIR if (retval >= 0) _gl_unregister_fd (fd); #endif return retval; }
/* Override close() to call into other gnulib modules: */ int rpl_close(int fd) { #if defined(WINDOWS_SOCKETS) && WINDOWS_SOCKETS int retval = execute_all_close_hooks(close_nothrow, fd); #else int retval = close_nothrow(fd); #endif /* WINDOWS_SOCKETS */ #if defined(REPLACE_FCHDIR) && REPLACE_FCHDIR if (retval >= 0) { _gl_unregister_fd(fd); } #endif /* REPLACE_FCHDIR */ return retval; }