1
1

- os_dirpath.c : reset the is_dir var each time through the loop.

- orte-clean.c : check to see if the base session directory is empty 
                 and delete it if it is.

- orte_universe_exists.c : Fix a down stread problem resulting from 
      George's r10718 commit. Don't use the 'fulldirpath' since
      that is no longer guarenteed to be the absolute path
      to the session directory. Construct this value outside of that
      function from the prefix and frontend vars.

This commit was SVN r10741.

The following SVN revision numbers were found above:
  r10718 --> open-mpi/ompi@47eef2e002
Этот коммит содержится в:
Josh Hursey 2006-07-11 17:31:05 +00:00
родитель fd39203262
Коммит 682a6a123e
3 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -211,6 +211,7 @@ int opal_os_dirpath_destroy(const char *path,
}
/* Check to see if it is a directory */
is_dir = false;
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
if (DT_DIR == ep->d_type) {
is_dir = true;
@ -297,6 +298,7 @@ int opal_os_dirpath_destroy(const char *path,
continue;
}
is_dir = false;
if(file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
is_dir = true;
}

Просмотреть файл

@ -71,7 +71,8 @@ int orte_universe_search(opal_list_t *universe_list) {
char *fulldirpath = NULL;
char *prefix = NULL;
char *frontend = NULL;
char *frontend_abs = NULL;
/*
* Get the session directory
*/
@ -89,10 +90,12 @@ int orte_universe_search(opal_list_t *universe_list) {
goto cleanup;
}
asprintf(&frontend_abs, "%s/%s", prefix, frontend);
/*
* Check to make sure we have access to this directory
*/
if( ORTE_SUCCESS != (ret = opal_os_dirpath_access(fulldirpath, 0) )) {
if( ORTE_SUCCESS != (ret = opal_os_dirpath_access(frontend_abs, 0) )) {
exit_status = ret;
goto cleanup;
}
@ -101,12 +104,12 @@ int orte_universe_search(opal_list_t *universe_list) {
* Open up the base directory so we can get a listing
*/
#ifndef __WINDOWS__
if( NULL == (cur_dirp = opendir(fulldirpath)) ) {
if( NULL == (cur_dirp = opendir(frontend_abs)) ) {
exit_status = ORTE_ERROR;
goto cleanup;
}
#else
hFind = FindFirstFile( fulldirpath, &file_data );
hFind = FindFirstFile( frontend_abs, &file_data );
#endif /* __WINDOWS__ */
/*
@ -130,7 +133,7 @@ int orte_universe_search(opal_list_t *universe_list) {
*/
tmp_str = strdup(dir_entry->d_name);
asprintf(&univ_setup_filename, "%s/%s/%s",
fulldirpath,
frontend_abs,
tmp_str,
"universe-setup.txt");
@ -165,7 +168,7 @@ int orte_universe_search(opal_list_t *universe_list) {
*/
tmp_str = strdup(file_data.cFileName);
asprintf(&univ_setup_filename, "%s/%s/%s",
fulldirpath,
frontend_abs,
tmp_str,
"universe-setup.txt");
@ -199,6 +202,8 @@ int orte_universe_search(opal_list_t *universe_list) {
free(prefix);
if( NULL != frontend)
free(frontend);
if( NULL != frontend_abs)
free(frontend_abs);
return exit_status;
}

Просмотреть файл

@ -295,6 +295,7 @@ static int orte_clean_universe(orte_universe_t *universe) {
char *prefix = NULL;
char *frontend = NULL;
char *command = NULL;
char *session_dir = NULL;
if( ORTE_SUCCESS != (ret = orte_session_dir_get_name(&fulldirpath,
&prefix,
@ -314,6 +315,11 @@ static int orte_clean_universe(orte_universe_t *universe) {
/********************
* If the session directory is empty, then remove that too
********************/
asprintf(&session_dir, "%s/%s", prefix, frontend);
opal_os_dirpath_destroy(session_dir, false, NULL );
/********************
* Need to check
* - openmpi-sessions-UID@gethostbyname()_0
* - openmpi-sessions-UID@localhost_0