From 36b824effd51b336c146f6aab46b8f9258642639 Mon Sep 17 00:00:00 2001 From: Josh Hursey Date: Mon, 22 Sep 2008 19:03:41 +0000 Subject: [PATCH] Make sure to protect the symbol, so builds that do not involve threads will build properly. Thanks to Jeff for pointing this out to me. This commit was SVN r19606. --- opal/runtime/opal_cr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/opal/runtime/opal_cr.c b/opal/runtime/opal_cr.c index 110ad60bf1..38708b8c76 100644 --- a/opal/runtime/opal_cr.c +++ b/opal/runtime/opal_cr.c @@ -270,11 +270,22 @@ int opal_cr_init(void ) "opal_cr: init: Debug SIGPIPE: %d (%s)", val, (opal_cr_debug_sigpipe ? "True" : "False")); +#if OPAL_ENABLE_FT_THREAD == 1 + /* If we have a thread, then attach the SIGPIPE signal handler there since + * it is most likely to be the one that needs it. + */ if( opal_cr_debug_sigpipe && !opal_cr_thread_use_if_avail ) { if( SIG_ERR == signal(SIGPIPE, opal_cr_sigpipe_debug_signal_handler) ) { ; } } +#else + if( opal_cr_debug_sigpipe ) { + if( SIG_ERR == signal(SIGPIPE, opal_cr_sigpipe_debug_signal_handler) ) { + ; + } + } +#endif #else opal_output( 0, "This feature is disabled on Windows" );