diff options
author | Nguyễn Thái Ngọc Duy | 2010-04-09 14:34:28 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-04-09 14:34:28 +0200 |
commit | 125d0154e6c591addbaf1fae7c9ffdf5b7e7ed7b (patch) | |
tree | d447fcdf0cefef523bc26d1de800f3db7e00dad9 /libbb/verror_msg.c | |
parent | e69ad87802139b7b62fc06ff5d5d09cc4245d5fc (diff) | |
download | busybox-125d0154e6c591addbaf1fae7c9ffdf5b7e7ed7b.zip busybox-125d0154e6c591addbaf1fae7c9ffdf5b7e7ed7b.tar.gz |
Exclude syslog code if FEATURE_SYSLOG is not set
syslog.h and syslog(...) may not exist in such configuration
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/verror_msg.c')
-rw-r--r-- | libbb/verror_msg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c index 70f792f..6134329 100644 --- a/libbb/verror_msg.c +++ b/libbb/verror_msg.c @@ -6,9 +6,10 @@ * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ - #include "libbb.h" -#include <syslog.h> +#if ENABLE_FEATURE_SYSLOG +# include <syslog.h> +#endif smallint logmode = LOGMODE_STDIO; const char *msg_eol = "\n"; @@ -67,9 +68,11 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) fflush_all(); full_write(STDERR_FILENO, msg, used); } +#if ENABLE_FEATURE_SYSLOG if (logmode & LOGMODE_SYSLOG) { syslog(LOG_ERR, "%s", msg + applet_len); } +#endif free(msg); } @@ -128,9 +131,11 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) fflush_all(); writev(STDERR_FILENO, iov, 3); } +# if ENABLE_FEATURE_SYSLOG if (logmode & LOGMODE_SYSLOG) { syslog(LOG_ERR, "%s", msgc); } +# endif free(msgc); } #endif |