summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMark Whitley2001-03-12 22:51:50 +0000
committerMark Whitley2001-03-12 22:51:50 +0000
commit6317c4baf79c25d7f77897b064eb4f0b7d9f070e (patch)
tree5fc8fe65a4903f6224925a72b53a4f46e2b0b1d3 /utility.c
parent4987bbf97924044c88007c45ee2674d97b93ad92 (diff)
downloadbusybox-6317c4baf79c25d7f77897b064eb4f0b7d9f070e.zip
busybox-6317c4baf79c25d7f77897b064eb4f0b7d9f070e.tar.gz
Applied patch from Gennady Feldman to split up syslogd.c into syslogd and
klogd (as it should be).
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 e54a3ea..c557130 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)
{