diff options
author | Rob Landley | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | Rob Landley | 2006-08-03 15:41:12 +0000 |
commit | d921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /sysklogd | |
parent | 6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff) | |
download | busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz |
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/klogd.c | 9 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 23 |
2 files changed, 5 insertions, 27 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index 92590d2..677c9e6 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -18,13 +18,6 @@ */ #include "busybox.h" -#include <stdio.h> -#include <stdlib.h> -#include <signal.h> /* for our signal() handlers */ -#include <string.h> /* strncpy() */ -#include <errno.h> /* errno and friends */ -#include <unistd.h> -#include <ctype.h> #include <sys/syslog.h> #include <sys/klog.h> @@ -66,7 +59,7 @@ int klogd_main(int argc, char **argv) #ifdef BB_NOMMU vfork_daemon_rexec(0, 1, argc, argv, "-n"); #else - bb_xdaemon(0, 1); + xdaemon(0, 1); #endif } } diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index dfff757..87313af 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -14,24 +14,9 @@ */ #include "busybox.h" -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <getopt.h> -#include <netdb.h> #include <paths.h> -#include <signal.h> -#include <stdarg.h> #include <stdbool.h> -#include <time.h> -#include <string.h> -#include <unistd.h> -#include <sys/socket.h> -#include <sys/types.h> #include <sys/un.h> -#include <sys/param.h> /* SYSLOG_NAMES defined to pull some extra junk from syslog.h */ #define SYSLOG_NAMES @@ -368,7 +353,7 @@ static void message(char *fmt, ...) static void init_RemoteLog(void) { memset(&remoteaddr, 0, sizeof(remoteaddr)); - remotefd = bb_xsocket(AF_INET, SOCK_DGRAM, 0); + remotefd = xsocket(AF_INET, SOCK_DGRAM, 0); remoteaddr.sin_family = AF_INET; remoteaddr.sin_addr = *(struct in_addr *) *(xgethostbyname(RemoteHost))->h_addr_list; remoteaddr.sin_port = htons(RemotePort); @@ -537,7 +522,7 @@ static void doSyslogd(void) memset(&sunx, 0, sizeof(sunx)); sunx.sun_family = AF_UNIX; strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path)); - sock_fd = bb_xsocket(AF_UNIX, SOCK_DGRAM, 0); + sock_fd = xsocket(AF_UNIX, SOCK_DGRAM, 0); addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path); if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) { bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG); @@ -623,7 +608,7 @@ int syslogd_main(int argc, char **argv) #endif #ifdef CONFIG_FEATURE_REMOTE_LOG case 'R': - RemoteHost = bb_xstrdup(optarg); + RemoteHost = xstrdup(optarg); if ((p = strchr(RemoteHost, ':'))) { RemotePort = atoi(p + 1); *p = '\0'; @@ -672,7 +657,7 @@ int syslogd_main(int argc, char **argv) #ifdef BB_NOMMU vfork_daemon_rexec(0, 1, argc, argv, "-n"); #else - bb_xdaemon(0, 1); + xdaemon(0, 1); #endif } doSyslogd(); |