*/
#include "libbb.h"
-#include <syslog.h>
+#if ENABLE_FEATURE_SYSLOG
+# include <syslog.h>
+#endif
void FAST_FUNC bb_info_msg(const char *s, ...)
{
vprintf(s, p);
fputs(msg_eol, stdout);
}
- if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
+# if ENABLE_FEATURE_SYSLOG
+ if (logmode & LOGMODE_SYSLOG)
vsyslog(LOG_INFO, s, p2);
+# endif
va_end(p2);
va_end(p);
#else
if (used < 0)
return;
- if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
+# if ENABLE_FEATURE_SYSLOG
+ if (logmode & LOGMODE_SYSLOG)
syslog(LOG_INFO, "%s", msg);
+# endif
if (logmode & LOGMODE_STDIO) {
fflush_all();
/* used = strlen(msg); - must be true already */
*
* 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";
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);
}
fflush_all();
writev(STDERR_FILENO, iov, 3);
}
+# if ENABLE_FEATURE_SYSLOG
if (logmode & LOGMODE_SYSLOG) {
syslog(LOG_ERR, "%s", msgc);
}
+# endif
free(msgc);
}
#endif