1
1

Create the key on windows too even if the security is lower.

This commit was SVN r12005.
Этот коммит содержится в:
George Bosilca 2006-10-05 05:39:49 +00:00
родитель c2d397ee7d
Коммит f51e3ec338

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

@ -64,10 +64,11 @@ int orte_pre_condition_transports(orte_app_context_t **app_context, size_t num_c
{ {
size_t i; size_t i;
char *cs_env; char *cs_env;
int fd_rand;
uint64_t unique_key[2]; uint64_t unique_key[2];
char string_key[ORTE_TRANSPORT_KEY_LEN + 1]; /* key + null */ char string_key[ORTE_TRANSPORT_KEY_LEN + 1]; /* key + null */
#if !defined(__WINDOWS__)
int fd_rand;
size_t bytes_read; size_t bytes_read;
struct stat buf; struct stat buf;
@ -89,6 +90,10 @@ int orte_pre_condition_transports(orte_app_context_t **app_context, size_t num_c
close(fd_rand); close(fd_rand);
} }
} }
#else
rand_s( &unique_key[0] );
rand_s( &unique_key[1] );
#endif /* !defined(__WINDOWS__) */
sprintf(string_key, ORTE_TRANSPORT_KEY_FMT, (long unsigned)unique_key[0], sprintf(string_key, ORTE_TRANSPORT_KEY_FMT, (long unsigned)unique_key[0],
(long unsigned)unique_key[1]); (long unsigned)unique_key[1]);
@ -100,7 +105,7 @@ int orte_pre_condition_transports(orte_app_context_t **app_context, size_t num_c
} }
for (i=0; i < num_context; i++) { for (i=0; i < num_context; i++) {
opal_setenv(cs_env, string_key, true, &app_context[i]->env); opal_setenv(cs_env, string_key, true, &app_context[i]->env);
} }
free(cs_env); free(cs_env);