33 * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
44 * University Research and Technology
55 * Corporation. All rights reserved.
6- * Copyright (c) 2004-2008 The University of Tennessee and The University
6+ * Copyright (c) 2004-2017 The University of Tennessee and The University
77 * of Tennessee Research Foundation. All rights
88 * reserved.
99 * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@@ -147,6 +147,7 @@ bool opal_output_init(void)
147147 }
148148 }
149149 str = getenv ("OPAL_OUTPUT_SYSLOG_PRI" );
150+ #ifdef HAVE_SYSLOG_H
150151 if (NULL != str ) {
151152 if (0 == strcasecmp (str , "info" )) {
152153 opal_output_redirected_syslog_pri = LOG_INFO ;
@@ -160,7 +161,7 @@ bool opal_output_init(void)
160161 } else {
161162 opal_output_redirected_syslog_pri = LOG_ERR ;
162163 }
163-
164+ #endif /* HAVE_SYSLOG_H */
164165 str = getenv ("OPAL_OUTPUT_SYSLOG_IDENT" );
165166 if (NULL != str ) {
166167 redirect_syslog_ident = strdup (str );
@@ -349,7 +350,7 @@ void opal_output_close(int output_id)
349350 }
350351 }
351352
352- #if defined(HAVE_SYSLOG )
353+ #if defined(HAVE_SYSLOG ) && defined( HAVE_SYSLOG_H )
353354 if (i >= OPAL_OUTPUT_MAX_STREAMS && syslog_opened ) {
354355 closelog ();
355356 }
@@ -612,7 +613,7 @@ static int do_open(int output_id, opal_output_stream_t * lds)
612613 info [i ].ldi_verbose_level = lds -> lds_verbose_level ;
613614
614615#if USE_SYSLOG
615- #if defined(HAVE_SYSLOG )
616+ #if defined(HAVE_SYSLOG ) && defined( HAVE_SYSLOG_H )
616617 if (opal_output_redirected_to_syslog ) {
617618 info [i ].ldi_syslog = true;
618619 info [i ].ldi_syslog_priority = opal_output_redirected_syslog_pri ;
@@ -629,7 +630,7 @@ static int do_open(int output_id, opal_output_stream_t * lds)
629630 info [i ].ldi_syslog = lds -> lds_want_syslog ;
630631 if (lds -> lds_want_syslog ) {
631632
632- #if defined(HAVE_SYSLOG )
633+ #if defined(HAVE_SYSLOG ) && defined( HAVE_SYSLOG_H )
633634 if (NULL != lds -> lds_syslog_ident ) {
634635 info [i ].ldi_syslog_ident = strdup (lds -> lds_syslog_ident );
635636 openlog (lds -> lds_syslog_ident , LOG_PID , LOG_USER );
@@ -642,7 +643,7 @@ static int do_open(int output_id, opal_output_stream_t * lds)
642643 info [i ].ldi_syslog_priority = lds -> lds_syslog_priority ;
643644 }
644645
645- #if defined(HAVE_SYSLOG )
646+ #if defined(HAVE_SYSLOG ) && defined( HAVE_SYSLOG_H )
646647 }
647648#endif
648649
@@ -951,7 +952,7 @@ static int output(int output_id, const char *format, va_list arglist)
951952 }
952953
953954 /* Syslog output -- does not use the newline-appended string */
954- #if defined(HAVE_SYSLOG )
955+ #if defined(HAVE_SYSLOG ) && defined( HAVE_SYSLOG_H )
955956 if (ldi -> ldi_syslog ) {
956957 syslog (ldi -> ldi_syslog_priority , "%s" , str );
957958 }
0 commit comments