From f3af79960814d1f9a878bf4cc3f542143f195992 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Sat, 8 Oct 2016 11:28:58 +0900 Subject: [PATCH] pmix3x: misc fixes to get pmix build on Solaris - replace MAXHOSTNAMELEN with hardcoded 1024. unlike Linux, Solaris #define MAXHOSTNAMELEN in , 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 pmix/master@a63f6e53f4f1f0851316875b3f21f0a25cadfa65) --- opal/mca/pmix/pmix3x/pmix/examples/dynamic.c | 4 +++- opal/mca/pmix/pmix3x/pmix/test/utils.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opal/mca/pmix/pmix3x/pmix/examples/dynamic.c b/opal/mca/pmix/pmix3x/pmix/examples/dynamic.c index 41a513420d..78b7ca7c41 100644 --- a/opal/mca/pmix/pmix3x/pmix/examples/dynamic.c +++ b/opal/mca/pmix/pmix3x/pmix/examples/dynamic.c @@ -15,6 +15,8 @@ * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. * Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved. + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +48,7 @@ int main(int argc, char **argv) uint32_t nprocs; char nsp2[PMIX_MAX_NSLEN+1]; pmix_app_t *app; - char hostname[MAXHOSTNAMELEN], dir[1024]; + char hostname[1024], dir[1024]; pmix_proc_t *peers; size_t npeers, ntmp=0; char *nodelist; diff --git a/opal/mca/pmix/pmix3x/pmix/test/utils.c b/opal/mca/pmix/pmix3x/pmix/test/utils.c index 87c7e6ad9f..fb864aedb5 100644 --- a/opal/mca/pmix/pmix3x/pmix/test/utils.c +++ b/opal/mca/pmix/pmix3x/pmix/test/utils.c @@ -2,6 +2,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -234,9 +236,7 @@ int launch_clients(int num_procs, char *binary, char *** client_env, char ***bas if (cli_info[counter].pid == 0) { if( !TEST_VERBOSE_GET() ){ // Hide clients stdout - // TODO: on some systems stdout is a constant, address this - fclose(stdout); - stdout = fopen("/dev/null","w"); + freopen("/dev/null","w", stdout); } execve(binary, client_argv, *client_env); /* Does not return */