From bdfd0d78bc44e73d693510e70087857785b3b521 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 24 Oct 2001 05:00:29 +0000 Subject: Major rework of the directory structure and the entire build system. -Erik --- sysklogd/Makefile | 38 ++++++++++++++++++++++++++++++++++++++ sysklogd/config.in | 16 ++++++++++++++++ sysklogd/klogd.c | 4 ++-- sysklogd/logger.c | 6 +++--- sysklogd/logread.c | 2 +- sysklogd/syslogd.c | 30 +++++++++++++++--------------- 6 files changed, 75 insertions(+), 21 deletions(-) create mode 100644 sysklogd/Makefile create mode 100644 sysklogd/config.in (limited to 'sysklogd') diff --git a/sysklogd/Makefile b/sysklogd/Makefile new file mode 100644 index 0000000..3bfe903 --- /dev/null +++ b/sysklogd/Makefile @@ -0,0 +1,38 @@ +# Makefile for busybox +# +# Copyright (C) 1999,2000,2001 by Erik Andersen +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +TOPDIR :=.. +L_TARGET := sysklogd.a + +obj-y := +obj-n := +obj- := + + +obj-$(CONFIG_KLOGD) += klogd.o +obj-$(CONFIG_LOGGER) += logger.o +obj-$(CONFIG_LOGREAD) += logread.o +obj-$(CONFIG_SYSLOGD) += syslogd.o + +# Hand off to toplevel Rules.mak +include $(TOPDIR)/Rules.mak + +clean: + rm -f $(L_TARGET) *.o core + diff --git a/sysklogd/config.in b/sysklogd/config.in new file mode 100644 index 0000000..8a8e420 --- /dev/null +++ b/sysklogd/config.in @@ -0,0 +1,16 @@ +# +# For a description of the syntax of this configuration file, +# see scripts/kbuild/config-language.txt. +# + +mainmenu_option next_comment +comment 'System Logging Utilities' + +bool 'klogd' CONFIG_KLOGD +bool 'logger' CONFIG_LOGGER +bool 'logread' CONFIG_LOGREAD +bool 'syslogd' CONFIG_SYSLOGD + + +endmenu + diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index d7b54e9..33bc783 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -6,8 +6,8 @@ * Changes: Made this a standalone busybox module which uses standalone * syslog() client interface. * - * Copyright (C) 1999,2000,2001 by Lineo, inc. - * Written by Erik Andersen , + * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen + * Copyright (C) 1999,2000,2001 by Erik Andersen * * Copyright (C) 2000 by Karl M. Hegbloom * diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 9f73091..380bde5 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -2,8 +2,8 @@ /* * Mini logger implementation for busybox * - * Copyright (C) 1999,2000,2001 by Lineo, inc. - * Written by Erik Andersen , + * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen + * Copyright (C) 1999,2000,2001 by Erik Andersen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #include #include "busybox.h" -#if !defined BB_SYSLOGD +#if !defined CONFIG_SYSLOGD #define SYSLOG_NAMES #include diff --git a/sysklogd/logread.c b/sysklogd/logread.c index d334962..13ff1ae 100644 --- a/sysklogd/logread.c +++ b/sysklogd/logread.c @@ -38,7 +38,7 @@ #if __GNU_LIBRARY__ < 5 #error Sorry. Looks like you are using libc5. #error libc5 shm support isnt good enough. -#error Please disable BB_FEATURE_IPC_SYSLOG +#error Please disable CONFIG_FEATURE_IPC_SYSLOG #endif diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 25bc68f..db6401c 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -2,8 +2,8 @@ /* * Mini syslogd implementation for busybox * - * Copyright (C) 1999,2000,2001 by Lineo, inc. - * Written by Erik Andersen , + * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen + * Copyright (C) 1999,2000,2001 by Erik Andersen * * Copyright (C) 2000 by Karl M. Hegbloom * @@ -65,7 +65,7 @@ static int MarkInterval = 20 * 60; /* localhost's name */ static char LocalHostName[32]; -#ifdef BB_FEATURE_REMOTE_LOG +#ifdef CONFIG_FEATURE_REMOTE_LOG #include /* udp socket for logging to remote host */ static int remotefd = -1; @@ -79,7 +79,7 @@ static int local_logging = FALSE; #endif /* circular buffer variables/structures */ -#ifdef BB_FEATURE_IPC_SYSLOG +#ifdef CONFIG_FEATURE_IPC_SYSLOG #include #include @@ -269,7 +269,7 @@ static void message (char *fmt, ...) fl.l_start = 0; fl.l_len = 1; -#ifdef BB_FEATURE_IPC_SYSLOG +#ifdef CONFIG_FEATURE_IPC_SYSLOG if ((circular_logging == TRUE) && (buf != NULL)){ char b[1024]; va_start (arguments, fmt); @@ -339,7 +339,7 @@ static void logMessage (int pri, char *msg) /* todo: supress duplicates */ -#ifdef BB_FEATURE_REMOTE_LOG +#ifdef CONFIG_FEATURE_REMOTE_LOG /* send message to remote logger */ if ( -1 != remotefd){ static const int IOV_COUNT = 2; @@ -372,7 +372,7 @@ static void quit_signal(int sig) { logMessage(LOG_SYSLOG | LOG_INFO, "System log daemon exiting."); unlink(lfile); -#ifdef BB_FEATURE_IPC_SYSLOG +#ifdef CONFIG_FEATURE_IPC_SYSLOG ipcsyslog_cleanup(); #endif @@ -392,7 +392,7 @@ static void domark(int sig) #define BUFSIZE 1023 static int serveConnection (int conn) { - RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); + RESERVE_CONFIG_BUFFER(tmpbuf, BUFSIZE + 1); int n_read; char *p = tmpbuf; @@ -433,12 +433,12 @@ static int serveConnection (int conn) /* Now log it */ logMessage (pri, line); } - RELEASE_BB_BUFFER (tmpbuf); + RELEASE_CONFIG_BUFFER (tmpbuf); return n_read; } -#ifdef BB_FEATURE_REMOTE_LOG +#ifdef CONFIG_FEATURE_REMOTE_LOG static void init_RemoteLog (void){ struct sockaddr_in remoteaddr; @@ -512,13 +512,13 @@ static void doSyslogd (void) FD_ZERO (&fds); FD_SET (sock_fd, &fds); -#ifdef BB_FEATURE_IPC_SYSLOG +#ifdef CONFIG_FEATURE_IPC_SYSLOG if (circular_logging == TRUE ){ ipcsyslog_init(); } #endif - #ifdef BB_FEATURE_REMOTE_LOG + #ifdef CONFIG_FEATURE_REMOTE_LOG if (doRemoteLog == TRUE){ init_RemoteLog(); } @@ -585,7 +585,7 @@ extern int syslogd_main(int argc, char **argv) case 'O': logFilePath = strdup(optarg); break; -#ifdef BB_FEATURE_REMOTE_LOG +#ifdef CONFIG_FEATURE_REMOTE_LOG case 'R': RemoteHost = strdup(optarg); if ( (p = strchr(RemoteHost, ':'))){ @@ -598,7 +598,7 @@ extern int syslogd_main(int argc, char **argv) local_logging = TRUE; break; #endif -#ifdef BB_FEATURE_IPC_SYSLOG +#ifdef CONFIG_FEATURE_IPC_SYSLOG case 'C': circular_logging = TRUE; break; @@ -608,7 +608,7 @@ extern int syslogd_main(int argc, char **argv) } } -#ifdef BB_FEATURE_REMOTE_LOG +#ifdef CONFIG_FEATURE_REMOTE_LOG /* If they have not specified remote logging, then log locally */ if (doRemoteLog == FALSE) local_logging = TRUE; -- cgit v1.1