fixes CID 2256.
This commit was SVN r25486.
Этот коммит содержится в:
родитель
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;
|
||||
}
|
||||
|
||||
/* ////////////////////////////////////////////////////////////////////////// */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user