diff options
author | Mark Whitley <markw@lineo.com> | 2001-03-12 22:51:50 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-03-12 22:51:50 +0000 |
commit | 6317c4baf79c25d7f77897b064eb4f0b7d9f070e (patch) | |
tree | 5fc8fe65a4903f6224925a72b53a4f46e2b0b1d3 /utility.c | |
parent | 4987bbf97924044c88007c45ee2674d97b93ad92 (diff) | |
download | busybox-w32-6317c4baf79c25d7f77897b064eb4f0b7d9f070e.tar.gz busybox-w32-6317c4baf79c25d7f77897b064eb4f0b7d9f070e.tar.bz2 busybox-w32-6317c4baf79c25d7f77897b064eb4f0b7d9f070e.zip |
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.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 | |||
80 | static struct BB_applet *applet_using; | 84 | static struct BB_applet *applet_using; |
81 | 85 | ||
82 | extern void show_usage(void) | 86 | extern 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) | ||
1836 | void 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 | |||
1843 | void 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) |
1832 | void trim(char *s) | 1850 | void trim(char *s) |
1833 | { | 1851 | { |