diff options
Diffstat (limited to 'libbb/info_msg.c')
-rw-r--r-- | libbb/info_msg.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libbb/info_msg.c b/libbb/info_msg.c index bc9d23b95..81164faa0 100644 --- a/libbb/info_msg.c +++ b/libbb/info_msg.c | |||
@@ -8,7 +8,9 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | #include <syslog.h> | 11 | #if ENABLE_FEATURE_SYSLOG |
12 | # include <syslog.h> | ||
13 | #endif | ||
12 | 14 | ||
13 | void FAST_FUNC bb_info_msg(const char *s, ...) | 15 | void FAST_FUNC bb_info_msg(const char *s, ...) |
14 | { | 16 | { |
@@ -24,8 +26,10 @@ void FAST_FUNC bb_info_msg(const char *s, ...) | |||
24 | vprintf(s, p); | 26 | vprintf(s, p); |
25 | fputs(msg_eol, stdout); | 27 | fputs(msg_eol, stdout); |
26 | } | 28 | } |
27 | if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) | 29 | # if ENABLE_FEATURE_SYSLOG |
30 | if (logmode & LOGMODE_SYSLOG) | ||
28 | vsyslog(LOG_INFO, s, p2); | 31 | vsyslog(LOG_INFO, s, p2); |
32 | # endif | ||
29 | va_end(p2); | 33 | va_end(p2); |
30 | va_end(p); | 34 | va_end(p); |
31 | #else | 35 | #else |
@@ -42,8 +46,10 @@ void FAST_FUNC bb_info_msg(const char *s, ...) | |||
42 | if (used < 0) | 46 | if (used < 0) |
43 | return; | 47 | return; |
44 | 48 | ||
45 | if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) | 49 | # if ENABLE_FEATURE_SYSLOG |
50 | if (logmode & LOGMODE_SYSLOG) | ||
46 | syslog(LOG_INFO, "%s", msg); | 51 | syslog(LOG_INFO, "%s", msg); |
52 | # endif | ||
47 | if (logmode & LOGMODE_STDIO) { | 53 | if (logmode & LOGMODE_STDIO) { |
48 | fflush_all(); | 54 | fflush_all(); |
49 | /* used = strlen(msg); - must be true already */ | 55 | /* used = strlen(msg); - must be true already */ |