aboutsummaryrefslogtreecommitdiff
path: root/libbb/verror_msg.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-05-27 11:56:52 +0100
committerRon Yorston <rmy@pobox.com>2019-05-27 11:56:52 +0100
commita61949401890cbb33a9d6c4571b51c53460ad438 (patch)
tree64dedaddb89896d5b1670a421af123670ca2120b /libbb/verror_msg.c
parent03a7b173605a890e1db5177ecd5b8dd591081c41 (diff)
parentbcb1fc3e6ca6fe902610f507eaf9b0b58a5c583a (diff)
downloadbusybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.tar.gz
busybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.tar.bz2
busybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/verror_msg.c')
-rw-r--r--libbb/verror_msg.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index 22c30357b..6d3459905 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -12,7 +12,7 @@
12#endif 12#endif
13 13
14#if ENABLE_FEATURE_SYSLOG 14#if ENABLE_FEATURE_SYSLOG
15smallint syslog_level = LOG_ERR; 15static smallint syslog_level = LOG_ERR;
16#endif 16#endif
17smallint logmode = LOGMODE_STDIO; 17smallint logmode = LOGMODE_STDIO;
18const char *msg_eol = "\n"; 18const char *msg_eol = "\n";
@@ -154,7 +154,7 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
154 } 154 }
155# if ENABLE_FEATURE_SYSLOG 155# if ENABLE_FEATURE_SYSLOG
156 if (logmode & LOGMODE_SYSLOG) { 156 if (logmode & LOGMODE_SYSLOG) {
157 syslog(LOG_ERR, "%s", msgc); 157 syslog(syslog_level, "%s", msgc);
158 } 158 }
159# endif 159# endif
160 free(msgc); 160 free(msgc);
@@ -180,3 +180,21 @@ void FAST_FUNC bb_error_msg(const char *s, ...)
180 bb_verror_msg(s, p, NULL); 180 bb_verror_msg(s, p, NULL);
181 va_end(p); 181 va_end(p);
182} 182}
183
184#if ENABLE_FEATURE_SYSLOG_INFO
185void FAST_FUNC bb_vinfo_msg(const char *s, va_list p)
186{
187 syslog_level = LOG_INFO;
188 bb_verror_msg(s, p, NULL);
189 syslog_level = LOG_ERR;
190}
191
192void FAST_FUNC bb_info_msg(const char *s, ...)
193{
194 va_list p;
195
196 va_start(p, s);
197 bb_vinfo_msg(s, p);
198 va_end(p);
199}
200#endif