aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/klogd.c9
-rw-r--r--sysklogd/syslogd.c23
2 files changed, 5 insertions, 27 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 92590d209..677c9e607 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -18,13 +18,6 @@
18 */ 18 */
19 19
20#include "busybox.h" 20#include "busybox.h"
21#include <stdio.h>
22#include <stdlib.h>
23#include <signal.h> /* for our signal() handlers */
24#include <string.h> /* strncpy() */
25#include <errno.h> /* errno and friends */
26#include <unistd.h>
27#include <ctype.h>
28#include <sys/syslog.h> 21#include <sys/syslog.h>
29#include <sys/klog.h> 22#include <sys/klog.h>
30 23
@@ -66,7 +59,7 @@ int klogd_main(int argc, char **argv)
66#ifdef BB_NOMMU 59#ifdef BB_NOMMU
67 vfork_daemon_rexec(0, 1, argc, argv, "-n"); 60 vfork_daemon_rexec(0, 1, argc, argv, "-n");
68#else 61#else
69 bb_xdaemon(0, 1); 62 xdaemon(0, 1);
70#endif 63#endif
71 } 64 }
72 } 65 }
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index dfff75728..87313af43 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -14,24 +14,9 @@
14 */ 14 */
15 15
16#include "busybox.h" 16#include "busybox.h"
17#include <stdio.h>
18#include <stdlib.h>
19#include <ctype.h>
20#include <errno.h>
21#include <fcntl.h>
22#include <getopt.h>
23#include <netdb.h>
24#include <paths.h> 17#include <paths.h>
25#include <signal.h>
26#include <stdarg.h>
27#include <stdbool.h> 18#include <stdbool.h>
28#include <time.h>
29#include <string.h>
30#include <unistd.h>
31#include <sys/socket.h>
32#include <sys/types.h>
33#include <sys/un.h> 19#include <sys/un.h>
34#include <sys/param.h>
35 20
36/* SYSLOG_NAMES defined to pull some extra junk from syslog.h */ 21/* SYSLOG_NAMES defined to pull some extra junk from syslog.h */
37#define SYSLOG_NAMES 22#define SYSLOG_NAMES
@@ -368,7 +353,7 @@ static void message(char *fmt, ...)
368static void init_RemoteLog(void) 353static void init_RemoteLog(void)
369{ 354{
370 memset(&remoteaddr, 0, sizeof(remoteaddr)); 355 memset(&remoteaddr, 0, sizeof(remoteaddr));
371 remotefd = bb_xsocket(AF_INET, SOCK_DGRAM, 0); 356 remotefd = xsocket(AF_INET, SOCK_DGRAM, 0);
372 remoteaddr.sin_family = AF_INET; 357 remoteaddr.sin_family = AF_INET;
373 remoteaddr.sin_addr = *(struct in_addr *) *(xgethostbyname(RemoteHost))->h_addr_list; 358 remoteaddr.sin_addr = *(struct in_addr *) *(xgethostbyname(RemoteHost))->h_addr_list;
374 remoteaddr.sin_port = htons(RemotePort); 359 remoteaddr.sin_port = htons(RemotePort);
@@ -537,7 +522,7 @@ static void doSyslogd(void)
537 memset(&sunx, 0, sizeof(sunx)); 522 memset(&sunx, 0, sizeof(sunx));
538 sunx.sun_family = AF_UNIX; 523 sunx.sun_family = AF_UNIX;
539 strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path)); 524 strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path));
540 sock_fd = bb_xsocket(AF_UNIX, SOCK_DGRAM, 0); 525 sock_fd = xsocket(AF_UNIX, SOCK_DGRAM, 0);
541 addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path); 526 addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path);
542 if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) { 527 if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) {
543 bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG); 528 bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG);
@@ -623,7 +608,7 @@ int syslogd_main(int argc, char **argv)
623#endif 608#endif
624#ifdef CONFIG_FEATURE_REMOTE_LOG 609#ifdef CONFIG_FEATURE_REMOTE_LOG
625 case 'R': 610 case 'R':
626 RemoteHost = bb_xstrdup(optarg); 611 RemoteHost = xstrdup(optarg);
627 if ((p = strchr(RemoteHost, ':'))) { 612 if ((p = strchr(RemoteHost, ':'))) {
628 RemotePort = atoi(p + 1); 613 RemotePort = atoi(p + 1);
629 *p = '\0'; 614 *p = '\0';
@@ -672,7 +657,7 @@ int syslogd_main(int argc, char **argv)
672#ifdef BB_NOMMU 657#ifdef BB_NOMMU
673 vfork_daemon_rexec(0, 1, argc, argv, "-n"); 658 vfork_daemon_rexec(0, 1, argc, argv, "-n");
674#else 659#else
675 bb_xdaemon(0, 1); 660 xdaemon(0, 1);
676#endif 661#endif
677 } 662 }
678 doSyslogd(); 663 doSyslogd();