From d83f5aea789f896c90208567a9e56599a439e90a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 17 Dec 2024 19:17:44 -0800 Subject: syslog: test for existence Some POSIX emulations may lack a reasonable syslog function (although syslog is required per the Open Group). For now we just check for it, and don't use it if it isn't present. --- src/core/log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/log.c') diff --git a/src/core/log.c b/src/core/log.c index 0084b06e..bbdac063 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -16,7 +16,7 @@ #ifdef NNG_PLATFORM_WINDOWS #include #endif -#ifdef NNG_PLATFORM_POSIX +#ifdef NNG_HAVE_SYSLOG #include #include #endif @@ -90,7 +90,7 @@ stderr_logger(nng_log_level level, nng_log_facility facility, #ifdef NNG_PLATFORM_WINDOWS // NB: We are blithely assuming the user has a modern console. colors = _isatty(_fileno(stderr)); -#elif defined(NNG_PLATFORM_POSIX) +#elif defined(NNG_HAVE_SYSLOG) // Only assuming we can use colors (and attributes) if stderr is a tty // and $TERM is reasonable. We assume the terminal supports ECMA-48, // which is true on every reasonable system these days. @@ -186,7 +186,7 @@ void nng_system_logger(nng_log_level level, nng_log_facility facility, const char *msgid, const char *msg) { -#ifdef NNG_PLATFORM_POSIX +#ifdef NNG_HAVE_SYSLOG int pri; switch (level) { case NNG_LOG_ERR: -- cgit v1.2.3-70-g09d2