diff options
-rw-r--r-- | src/conn/conn_api.c | 2 | ||||
-rw-r--r-- | src/conn/conn_handle.c | 10 | ||||
-rw-r--r-- | src/conn/conn_open.c | 2 | ||||
-rw-r--r-- | src/include/extern.h | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index c5ef15ea130..ee175fff2c6 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -959,7 +959,7 @@ err: if (cbuf != NULL) __wt_buf_free(session, &exconfig); if (ret != 0 && conn != NULL) - __wt_connection_destroy(conn); + WT_TRET(__wt_connection_destroy(conn)); return (ret); } diff --git a/src/conn/conn_handle.c b/src/conn/conn_handle.c index 2d8a47078b1..ef698f335be 100644 --- a/src/conn/conn_handle.c +++ b/src/conn/conn_handle.c @@ -44,16 +44,17 @@ __wt_connection_init(WT_CONNECTION_IMPL *conn) * __wt_connection_destroy -- * Destroy the connection's underlying WT_CONNECTION_IMPL structure. */ -void +int __wt_connection_destroy(WT_CONNECTION_IMPL *conn) { + WT_DECL_RET; WT_SESSION_IMPL *session; session = conn->default_session; /* Check there's something to destroy. */ if (conn == NULL) - return; + return (0); /* * Close remaining open files (before discarding the mutex, the @@ -61,10 +62,10 @@ __wt_connection_destroy(WT_CONNECTION_IMPL *conn) * open files. */ if (conn->lock_fh != NULL) - (void)__wt_close(session, conn->lock_fh); + WT_TRET(__wt_close(session, conn->lock_fh)); if (conn->log_fh != NULL) - (void)__wt_close(session, conn->log_fh); + WT_TRET(__wt_close(session, conn->log_fh)); /* Remove from the list of connections. */ __wt_spin_lock(session, &__wt_process.spinlock); @@ -83,4 +84,5 @@ __wt_connection_destroy(WT_CONNECTION_IMPL *conn) __wt_free(session, conn->stats); __wt_free(NULL, conn); + return (ret); } diff --git a/src/conn/conn_open.c b/src/conn/conn_open.c index c423625fcbe..27b85cefa56 100644 --- a/src/conn/conn_open.c +++ b/src/conn/conn_open.c @@ -125,7 +125,7 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn) } /* Destroy the handle. */ - __wt_connection_destroy(conn); + WT_TRET(__wt_connection_destroy(conn)); return (ret); } diff --git a/src/include/extern.h b/src/include/extern.h index 636b4633d0a..916f85a77c6 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -644,7 +644,7 @@ extern int __wt_conn_cache_pool_open(WT_SESSION_IMPL *session); extern int __wt_conn_cache_pool_destroy(WT_CONNECTION_IMPL *conn); extern void *__wt_cache_pool_server(void *arg); extern int __wt_connection_init(WT_CONNECTION_IMPL *conn); -extern void __wt_connection_destroy(WT_CONNECTION_IMPL *conn); +extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn); extern int __wt_connection_open(WT_CONNECTION_IMPL *conn, const char *cfg[]); extern int __wt_connection_close(WT_CONNECTION_IMPL *conn); extern void __wt_conn_stat_init(WT_SESSION_IMPL *session, uint32_t flags); |