summaryrefslogtreecommitdiffhomepage
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";
# endif
#endif
+#if defined(BB_KLOGD) || defined(BB_LOGGER)
+#include <syslog.h>
+#endif
+
static struct BB_applet *applet_using;
extern void show_usage(void)
@@ -1828,6 +1832,20 @@ void chomp(char *s)
}
#endif
+#if defined(BB_KLOGD) || defined(BB_LOGGER)
+void syslog_msg_with_name(const char *name, int facility, int pri, const char *msg)
+{
+ openlog(name, 0, facility);
+ syslog(pri, "%s", msg);
+ closelog();
+}
+
+void syslog_msg(int facility, int pri, const char *msg)
+{
+ syslog_msg_with_name(applet_using->name, facility, pri, msg);
+}
+#endif
+
#if defined(BB_SH)
void trim(char *s)
{