summaryrefslogtreecommitdiffhomepage
path: root/utility.c
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-03-12 22:51:50 +0000
committerMark Whitley <markw@lineo.com>2001-03-12 22:51:50 +0000
commit6317c4baf79c25d7f77897b064eb4f0b7d9f070e (patch)
tree5fc8fe65a4903f6224925a72b53a4f46e2b0b1d3 /utility.c
parent4987bbf97924044c88007c45ee2674d97b93ad92 (diff)
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 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)
{