1
1
This commit was SVN r25486.
Этот коммит содержится в:
Samuel Gutierrez 2011-11-17 18:06:28 +00:00
родитель d320551aca
Коммит 47499d1d3d

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

@ -211,7 +211,7 @@ path_usable(const char *path, int *stat_errno)
static char *
get_uniq_file_name(const char *base_path, const char *hash_key)
{
char uniq_name_buf[OPAL_PATH_MAX];
char *uniq_name_buf = NULL;
unsigned long str_hash = 0;
pid_t my_pid;
int rand_num;
@ -220,6 +220,10 @@ get_uniq_file_name(const char *base_path, const char *hash_key)
if (NULL == hash_key) {
return NULL;
}
if (NULL == (uniq_name_buf = calloc(OPAL_PATH_MAX, sizeof(char)))) {
/* out of resources */
return NULL;
}
my_pid = getpid();
srand((unsigned int)(time(NULL) + my_pid));
@ -229,7 +233,7 @@ get_uniq_file_name(const char *base_path, const char *hash_key)
snprintf(uniq_name_buf, OPAL_PATH_MAX, "%s/open_mpi_shmem_mmap.%d_%lu_%d",
base_path, (int)my_pid, str_hash, rand_num);
return strdup(uniq_name_buf);
return uniq_name_buf;
}
/* ////////////////////////////////////////////////////////////////////////// */