summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
commit828e7e2416b3193b5964c0ab13b95a605088bd02 (patch)
treea9b7ab02a83f4df9c58444f7c6961da3b8d8aa6a /test/h5test.c
parentddf384fb35052913970bcabd7b247f4280be08fc (diff)
downloadhdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.zip
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.gz
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.bz2
[svn-r16566] Description:
Bring r16560 back from trunk. Tested on: Mac OS X/32 10.5.6 (amazon) debug & production (Following up with tests on more platforms)
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 029ca3e..f5bf180 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1031,49 +1031,45 @@ int h5_szip_can_encode(void )
*
*-------------------------------------------------------------------------
*/
-
-char* getenv_all(MPI_Comm comm, int root, const char* name)
+char *
+getenv_all(MPI_Comm comm, int root, const char* name)
{
int mpi_size, mpi_rank, mpi_initialized;
int len;
static char* env = NULL;
- MPI_Status Status;
assert(name);
MPI_Initialized(&mpi_initialized);
- if (!mpi_initialized){
+ if(!mpi_initialized) {
/* use original getenv */
if(env)
HDfree(env);
env = HDgetenv(name);
- }else{
+ } /* end if */
+ else {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
assert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
- if(mpi_rank == root)
- {
+ if(mpi_rank == root) {
env = HDgetenv(name);
- if(env)
- {
+ if(env) {
len = HDstrlen(env);
MPI_Bcast(&len, 1, MPI_INT, root, comm);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
}
- else{
+ else {
/* len -1 indicates that the variable was not in the environment */
len = -1;
MPI_Bcast(&len, 1, MPI_INT, root, comm);
}
}
- else
- {
+ else {
MPI_Bcast(&len, 1, MPI_INT, root, comm);
- if(len >= 0)
- {
+ if(len >= 0) {
if(env == NULL)
env = (char*) HDmalloc(len+1);
else if(strlen(env) < len)
@@ -1082,8 +1078,7 @@ char* getenv_all(MPI_Comm comm, int root, const char* name)
MPI_Bcast(env, len, MPI_CHAR, root, comm);
env[len] = '\0';
}
- else
- {
+ else {
if(env)
HDfree(env);
env = NULL;