diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2017-03-15 15:46:41 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2017-03-15 15:46:41 (GMT) |
commit | 8933601d147bdedd83a41cc73213f273a1452742 (patch) | |
tree | fccd4548aae04a0a7a0692642c3603bfe8545bdd /src | |
parent | f8d952f9233b3eb8231460dbd2a8b2212d8e3899 (diff) | |
download | hdf5-8933601d147bdedd83a41cc73213f273a1452742.zip hdf5-8933601d147bdedd83a41cc73213f273a1452742.tar.gz hdf5-8933601d147bdedd83a41cc73213f273a1452742.tar.bz2 |
Modify H5VLdaosm_term to similarly only execute once. Also modify that
function to unregister the VOL plugin.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLdaosm.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c index b11e49a..6da4ab5 100644 --- a/src/H5VLdaosm.c +++ b/src/H5VLdaosm.c @@ -514,18 +514,22 @@ H5VL__daosm_term(void) FUNC_ENTER_STATIC - /* Disconnect from pool */ - if(!daos_handle_is_inval(H5VL_daosm_poh_g)) { - if(0 != (ret = daos_pool_disconnect(H5VL_daosm_poh_g, NULL /*event*/))) - HGOTO_ERROR(H5E_VOL, H5E_CLOSEERROR, FAIL, "can't disconnect from pool: %d", ret) - H5VL_daosm_poh_g = DAOS_HDL_INVAL; - } /* end if */ + if(H5VL_DAOSM_g >= 0) { + /* Disconnect from pool */ + if(!daos_handle_is_inval(H5VL_daosm_poh_g)) { + if(0 != (ret = daos_pool_disconnect(H5VL_daosm_poh_g, NULL /*event*/))) + HGOTO_ERROR(H5E_VOL, H5E_CLOSEERROR, FAIL, "can't disconnect from pool: %d", ret) + H5VL_daosm_poh_g = DAOS_HDL_INVAL; + } /* end if */ - /* Terminate DAOS */ - (void)daos_fini(); + /* Terminate DAOS */ + (void)daos_fini(); - /* Reset VOL ID */ - H5VL_DAOSM_g = 0; + /* Unregister VOL plugin */ + if(H5Idec_ref(H5VL_DAOSM_g) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CLOSEERROR, FAIL, "can't unregister DAOS-M VOL plugin") + H5VL_DAOSM_g = -1; + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) |