From 3a8d251daa1c634fc875a1d9cdc1ec69bab398a8 Mon Sep 17 00:00:00 2001 From: Nysal Jan Date: Wed, 2 Feb 2011 10:05:57 +0000 Subject: [PATCH] vsyslog is not included in SUSv3. Add a check for platforms that do not have vsyslog This commit was SVN r24339. --- configure.ac | 2 +- orte/mca/notifier/syslog/notifier_syslog_module.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3b16c9bf78..4d3fce737a 100644 --- a/configure.ac +++ b/configure.ac @@ -699,7 +699,7 @@ OMPI_CHECK_FUNC_LIB([dirname], [gen]) # Darwin doesn't need -lm, as it's a symlink to libSystem.dylib OMPI_CHECK_FUNC_LIB([ceil], [m]) -AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s _strdup usleep mkfifo dbopen dbm_open]) +AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s _strdup usleep mkfifo dbopen dbm_open]) # On some hosts, htonl is a define, so the AC_CHECK_FUNC will get # confused. On others, it's in the standard library, but stubbed with diff --git a/orte/mca/notifier/syslog/notifier_syslog_module.c b/orte/mca/notifier/syslog/notifier_syslog_module.c index ed7de64db9..981503d287 100644 --- a/orte/mca/notifier/syslog/notifier_syslog_module.c +++ b/orte/mca/notifier/syslog/notifier_syslog_module.c @@ -82,7 +82,14 @@ static void mylog(orte_notifier_base_severity_t severity, int errcode, const char *msg, va_list ap) { /* If there was a message, output it */ +#if defined(HAVE_VSYSLOG) vsyslog(severity, msg, ap); +#else + char *output; + vasprintf(&output, msg, ap); + syslog(severity, output); + free(output); +#endif } static void myhelplog(orte_notifier_base_severity_t severity, int errcode,