aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index e54a3ea65..c557130b9 100644
--- a/utility.c
+++ b/utility.c
@@ -77,6 +77,10 @@ const char mtab_file[] = "/proc/mounts";
77# endif 77# endif
78#endif 78#endif
79 79
80#if defined(BB_KLOGD) || defined(BB_LOGGER)
81#include <syslog.h>
82#endif
83
80static struct BB_applet *applet_using; 84static struct BB_applet *applet_using;
81 85
82extern void show_usage(void) 86extern void show_usage(void)
@@ -1828,6 +1832,20 @@ void chomp(char *s)
1828} 1832}
1829#endif 1833#endif
1830 1834
1835#if defined(BB_KLOGD) || defined(BB_LOGGER)
1836void syslog_msg_with_name(const char *name, int facility, int pri, const char *msg)
1837{
1838 openlog(name, 0, facility);
1839 syslog(pri, "%s", msg);
1840 closelog();
1841}
1842
1843void syslog_msg(int facility, int pri, const char *msg)
1844{
1845 syslog_msg_with_name(applet_using->name, facility, pri, msg);
1846}
1847#endif
1848
1831#if defined(BB_SH) 1849#if defined(BB_SH)
1832void trim(char *s) 1850void trim(char *s)
1833{ 1851{