Skip to content

Commit 74a11d7

Browse files
committed
Fix session dir cleanup code.
1 parent dc0ab67 commit 74a11d7

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

orte/mca/ess/pmi/ess_pmi_module.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static int rte_init(void)
9494
uint16_t u16, *u16ptr;
9595
char **peers=NULL, *mycpuset, **cpusets=NULL;
9696
opal_process_name_t wildcard_rank, pname;
97-
bool bool_val, tdir_mca_override = false;
97+
bool bool_val, *bool_ptr = &bool_val, tdir_mca_override = false;
9898
size_t i;
9999

100100
/* run the prolog */
@@ -247,7 +247,7 @@ static int rte_init(void)
247247
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_TMPDIR, &wildcard_rank, &val, OPAL_STRING);
248248
if (OPAL_SUCCESS == ret && NULL != val) {
249249
/* TODO: who has precedence - pmix of MCA setting??? */
250-
if( NULL != orte_process_info.top_session_dir ){
250+
if( NULL == orte_process_info.top_session_dir ){
251251
orte_process_info.top_session_dir = val;
252252
} else {
253253
/* keep the MCA setting */
@@ -288,9 +288,9 @@ static int rte_init(void)
288288
}
289289

290290
if( !tdir_mca_override ){
291-
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_TDIR_RMCLEAN, &wildcard_rank, &bool_val, OPAL_BOOL);
291+
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_TDIR_RMCLEAN, &wildcard_rank, &bool_ptr, OPAL_BOOL);
292292
if (OPAL_SUCCESS == ret ) {
293-
orte_process_info.rm_session_dirs = val;
293+
orte_process_info.rm_session_dirs = bool_val;
294294
}
295295
}
296296

orte/util/session_dir.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ int
444444
orte_session_dir_finalize(orte_process_name_t *proc)
445445
{
446446
int rc;
447-
char *tmp;
448-
char *job_session_dir, *vpid, *proc_session_dir;
449447

450448
if (!orte_create_session_dirs || orte_process_info.rm_session_dirs ) {
451449
/* we haven't created them or RM will clean them up for us*/
@@ -512,7 +510,7 @@ orte_session_dir_finalize(orte_process_name_t *proc)
512510
if (orte_debug_flag) {
513511
opal_output(0, "sess_dir_finalize: found top session dir empty - deleting");
514512
}
515-
rmdir(tmp);
513+
rmdir(orte_process_info.top_session_dir);
516514
} else {
517515
if (orte_debug_flag) {
518516
if (OPAL_ERR_NOT_FOUND ==

0 commit comments

Comments
 (0)