Skip to content

Commit f3af799

Browse files
committed
pmix3x: misc fixes to get pmix build on Solaris
- replace MAXHOSTNAMELEN with hardcoded 1024. unlike Linux, Solaris #define MAXHOSTNAMELEN in <netdb.h>, so use a hard coded value to keep the test simpl - stdout cannot be assigned on Solaris, so use freopen instead (back-ported from upstream commit openpmix/openpmix@a63f6e5)
1 parent 5cbfddb commit f3af799

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

opal/mca/pmix/pmix3x/pmix/examples/dynamic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
1616
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
18+
* Copyright (c) 2016 Research Organization for Information Science
19+
* and Technology (RIST). All rights reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -46,7 +48,7 @@ int main(int argc, char **argv)
4648
uint32_t nprocs;
4749
char nsp2[PMIX_MAX_NSLEN+1];
4850
pmix_app_t *app;
49-
char hostname[MAXHOSTNAMELEN], dir[1024];
51+
char hostname[1024], dir[1024];
5052
pmix_proc_t *peers;
5153
size_t npeers, ntmp=0;
5254
char *nodelist;

opal/mca/pmix/pmix3x/pmix/test/utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2015 Intel, Inc. All rights reserved.
33
* Copyright (c) 2015 Mellanox Technologies, Inc.
44
* All rights reserved.
5+
* Copyright (c) 2016 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -234,9 +236,7 @@ int launch_clients(int num_procs, char *binary, char *** client_env, char ***bas
234236
if (cli_info[counter].pid == 0) {
235237
if( !TEST_VERBOSE_GET() ){
236238
// Hide clients stdout
237-
// TODO: on some systems stdout is a constant, address this
238-
fclose(stdout);
239-
stdout = fopen("/dev/null","w");
239+
freopen("/dev/null","w", stdout);
240240
}
241241
execve(binary, client_argv, *client_env);
242242
/* Does not return */

0 commit comments

Comments
 (0)