Skip to content
Snippets Groups Projects
Commit d7bd3ca2 authored by Mark Grondona's avatar Mark Grondona
Browse files

o close handle to elanctrl device when no longer needed

parent a8b92a67
No related branches found
No related tags found
No related merge requests found
...@@ -728,8 +728,11 @@ qsw_prog_init(qsw_jobinfo_t jobinfo, uid_t uid) ...@@ -728,8 +728,11 @@ qsw_prog_init(qsw_jobinfo_t jobinfo, uid_t uid)
if (elanctrl_create_cap(handle, &jobinfo->j_cap) < 0) { if (elanctrl_create_cap(handle, &jobinfo->j_cap) < 0) {
error("elanctrl_create_cap: %m"); error("elanctrl_create_cap: %m");
slurm_seterrno(EELAN3CREATE); slurm_seterrno(EELAN3CREATE);
elanctrl_close(handle);
goto fail; goto fail;
} }
elanctrl_close (handle);
} }
#else /* !HAVE_LIBELANCTRL */ #else /* !HAVE_LIBELANCTRL */
...@@ -843,11 +846,14 @@ qsw_getnodeid(void) ...@@ -843,11 +846,14 @@ qsw_getnodeid(void)
if (elanctrl_open(&handle) != 0) if (elanctrl_open(&handle) != 0)
slurm_seterrno_ret(EGETNODEID); slurm_seterrno_ret(EGETNODEID);
if (elanctrl_get_position(handle, devidx, &position) != 0) if (elanctrl_get_position(handle, devidx, &position) != 0) {
elanctrl_close (handle);
slurm_seterrno_ret(EGETNODEID); slurm_seterrno_ret(EGETNODEID);
}
nodeid = position.pos_nodeid; nodeid = position.pos_nodeid;
elanctrl_close (handle);
#else #else
ELAN3_CTX *ctx = _elan3_init(0); /* rail 0 */ ELAN3_CTX *ctx = _elan3_init(0); /* rail 0 */
if (ctx) { if (ctx) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment