diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
| commit | bdfd0d78bc44e73d693510e70087857785b3b521 (patch) | |
| tree | 153a573095afac8d8d0ea857759ecabd77fb28b7 /sysklogd | |
| parent | 9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff) | |
| download | busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2 busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip | |
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'sysklogd')
| -rw-r--r-- | sysklogd/Makefile | 38 | ||||
| -rw-r--r-- | sysklogd/config.in | 16 | ||||
| -rw-r--r-- | sysklogd/klogd.c | 4 | ||||
| -rw-r--r-- | sysklogd/logger.c | 6 | ||||
| -rw-r--r-- | sysklogd/logread.c | 2 | ||||
| -rw-r--r-- | sysklogd/syslogd.c | 30 |
6 files changed, 75 insertions, 21 deletions
diff --git a/sysklogd/Makefile b/sysklogd/Makefile new file mode 100644 index 000000000..3bfe90324 --- /dev/null +++ b/sysklogd/Makefile | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | # Makefile for busybox | ||
| 2 | # | ||
| 3 | # Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> | ||
| 4 | # | ||
| 5 | # This program is free software; you can redistribute it and/or modify | ||
| 6 | # it under the terms of the GNU General Public License as published by | ||
| 7 | # the Free Software Foundation; either version 2 of the License, or | ||
| 8 | # (at your option) any later version. | ||
| 9 | # | ||
| 10 | # This program is distributed in the hope that it will be useful, | ||
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | # General Public License for more details. | ||
| 14 | # | ||
| 15 | # You should have received a copy of the GNU General Public License | ||
| 16 | # along with this program; if not, write to the Free Software | ||
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | # | ||
| 19 | |||
| 20 | TOPDIR :=.. | ||
| 21 | L_TARGET := sysklogd.a | ||
| 22 | |||
| 23 | obj-y := | ||
| 24 | obj-n := | ||
| 25 | obj- := | ||
| 26 | |||
| 27 | |||
| 28 | obj-$(CONFIG_KLOGD) += klogd.o | ||
| 29 | obj-$(CONFIG_LOGGER) += logger.o | ||
| 30 | obj-$(CONFIG_LOGREAD) += logread.o | ||
| 31 | obj-$(CONFIG_SYSLOGD) += syslogd.o | ||
| 32 | |||
| 33 | # Hand off to toplevel Rules.mak | ||
| 34 | include $(TOPDIR)/Rules.mak | ||
| 35 | |||
| 36 | clean: | ||
| 37 | rm -f $(L_TARGET) *.o core | ||
| 38 | |||
diff --git a/sysklogd/config.in b/sysklogd/config.in new file mode 100644 index 000000000..8a8e42086 --- /dev/null +++ b/sysklogd/config.in | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # | ||
| 2 | # For a description of the syntax of this configuration file, | ||
| 3 | # see scripts/kbuild/config-language.txt. | ||
| 4 | # | ||
| 5 | |||
| 6 | mainmenu_option next_comment | ||
| 7 | comment 'System Logging Utilities' | ||
| 8 | |||
| 9 | bool 'klogd' CONFIG_KLOGD | ||
| 10 | bool 'logger' CONFIG_LOGGER | ||
| 11 | bool 'logread' CONFIG_LOGREAD | ||
| 12 | bool 'syslogd' CONFIG_SYSLOGD | ||
| 13 | |||
| 14 | |||
| 15 | endmenu | ||
| 16 | |||
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index d7b54e9c8..33bc783fe 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | * Changes: Made this a standalone busybox module which uses standalone | 6 | * Changes: Made this a standalone busybox module which uses standalone |
| 7 | * syslog() client interface. | 7 | * syslog() client interface. |
| 8 | * | 8 | * |
| 9 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 9 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
| 10 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 10 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
| 11 | * | 11 | * |
| 12 | * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> | 12 | * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> |
| 13 | * | 13 | * |
diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 9f730915f..380bde5ca 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | /* | 2 | /* |
| 3 | * Mini logger implementation for busybox | 3 | * Mini logger implementation for busybox |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
| 6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
| 7 | * | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
| @@ -30,7 +30,7 @@ | |||
| 30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
| 31 | 31 | ||
| 32 | #include "busybox.h" | 32 | #include "busybox.h" |
| 33 | #if !defined BB_SYSLOGD | 33 | #if !defined CONFIG_SYSLOGD |
| 34 | 34 | ||
| 35 | #define SYSLOG_NAMES | 35 | #define SYSLOG_NAMES |
| 36 | #include <sys/syslog.h> | 36 | #include <sys/syslog.h> |
diff --git a/sysklogd/logread.c b/sysklogd/logread.c index d3349625c..13ff1aeb9 100644 --- a/sysklogd/logread.c +++ b/sysklogd/logread.c | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | #if __GNU_LIBRARY__ < 5 | 38 | #if __GNU_LIBRARY__ < 5 |
| 39 | #error Sorry. Looks like you are using libc5. | 39 | #error Sorry. Looks like you are using libc5. |
| 40 | #error libc5 shm support isnt good enough. | 40 | #error libc5 shm support isnt good enough. |
| 41 | #error Please disable BB_FEATURE_IPC_SYSLOG | 41 | #error Please disable CONFIG_FEATURE_IPC_SYSLOG |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | 44 | ||
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 25bc68f20..db6401c52 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | /* | 2 | /* |
| 3 | * Mini syslogd implementation for busybox | 3 | * Mini syslogd implementation for busybox |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
| 6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
| 7 | * | 7 | * |
| 8 | * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> | 8 | * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> |
| 9 | * | 9 | * |
| @@ -65,7 +65,7 @@ static int MarkInterval = 20 * 60; | |||
| 65 | /* localhost's name */ | 65 | /* localhost's name */ |
| 66 | static char LocalHostName[32]; | 66 | static char LocalHostName[32]; |
| 67 | 67 | ||
| 68 | #ifdef BB_FEATURE_REMOTE_LOG | 68 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 69 | #include <netinet/in.h> | 69 | #include <netinet/in.h> |
| 70 | /* udp socket for logging to remote host */ | 70 | /* udp socket for logging to remote host */ |
| 71 | static int remotefd = -1; | 71 | static int remotefd = -1; |
| @@ -79,7 +79,7 @@ static int local_logging = FALSE; | |||
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | /* circular buffer variables/structures */ | 81 | /* circular buffer variables/structures */ |
| 82 | #ifdef BB_FEATURE_IPC_SYSLOG | 82 | #ifdef CONFIG_FEATURE_IPC_SYSLOG |
| 83 | 83 | ||
| 84 | #include <sys/ipc.h> | 84 | #include <sys/ipc.h> |
| 85 | #include <sys/sem.h> | 85 | #include <sys/sem.h> |
| @@ -269,7 +269,7 @@ static void message (char *fmt, ...) | |||
| 269 | fl.l_start = 0; | 269 | fl.l_start = 0; |
| 270 | fl.l_len = 1; | 270 | fl.l_len = 1; |
| 271 | 271 | ||
| 272 | #ifdef BB_FEATURE_IPC_SYSLOG | 272 | #ifdef CONFIG_FEATURE_IPC_SYSLOG |
| 273 | if ((circular_logging == TRUE) && (buf != NULL)){ | 273 | if ((circular_logging == TRUE) && (buf != NULL)){ |
| 274 | char b[1024]; | 274 | char b[1024]; |
| 275 | va_start (arguments, fmt); | 275 | va_start (arguments, fmt); |
| @@ -339,7 +339,7 @@ static void logMessage (int pri, char *msg) | |||
| 339 | 339 | ||
| 340 | /* todo: supress duplicates */ | 340 | /* todo: supress duplicates */ |
| 341 | 341 | ||
| 342 | #ifdef BB_FEATURE_REMOTE_LOG | 342 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 343 | /* send message to remote logger */ | 343 | /* send message to remote logger */ |
| 344 | if ( -1 != remotefd){ | 344 | if ( -1 != remotefd){ |
| 345 | static const int IOV_COUNT = 2; | 345 | static const int IOV_COUNT = 2; |
| @@ -372,7 +372,7 @@ static void quit_signal(int sig) | |||
| 372 | { | 372 | { |
| 373 | logMessage(LOG_SYSLOG | LOG_INFO, "System log daemon exiting."); | 373 | logMessage(LOG_SYSLOG | LOG_INFO, "System log daemon exiting."); |
| 374 | unlink(lfile); | 374 | unlink(lfile); |
| 375 | #ifdef BB_FEATURE_IPC_SYSLOG | 375 | #ifdef CONFIG_FEATURE_IPC_SYSLOG |
| 376 | ipcsyslog_cleanup(); | 376 | ipcsyslog_cleanup(); |
| 377 | #endif | 377 | #endif |
| 378 | 378 | ||
| @@ -392,7 +392,7 @@ static void domark(int sig) | |||
| 392 | #define BUFSIZE 1023 | 392 | #define BUFSIZE 1023 |
| 393 | static int serveConnection (int conn) | 393 | static int serveConnection (int conn) |
| 394 | { | 394 | { |
| 395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); | 395 | RESERVE_CONFIG_BUFFER(tmpbuf, BUFSIZE + 1); |
| 396 | int n_read; | 396 | int n_read; |
| 397 | char *p = tmpbuf; | 397 | char *p = tmpbuf; |
| 398 | 398 | ||
| @@ -433,12 +433,12 @@ static int serveConnection (int conn) | |||
| 433 | /* Now log it */ | 433 | /* Now log it */ |
| 434 | logMessage (pri, line); | 434 | logMessage (pri, line); |
| 435 | } | 435 | } |
| 436 | RELEASE_BB_BUFFER (tmpbuf); | 436 | RELEASE_CONFIG_BUFFER (tmpbuf); |
| 437 | return n_read; | 437 | return n_read; |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | 440 | ||
| 441 | #ifdef BB_FEATURE_REMOTE_LOG | 441 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 442 | static void init_RemoteLog (void){ | 442 | static void init_RemoteLog (void){ |
| 443 | 443 | ||
| 444 | struct sockaddr_in remoteaddr; | 444 | struct sockaddr_in remoteaddr; |
| @@ -512,13 +512,13 @@ static void doSyslogd (void) | |||
| 512 | FD_ZERO (&fds); | 512 | FD_ZERO (&fds); |
| 513 | FD_SET (sock_fd, &fds); | 513 | FD_SET (sock_fd, &fds); |
| 514 | 514 | ||
| 515 | #ifdef BB_FEATURE_IPC_SYSLOG | 515 | #ifdef CONFIG_FEATURE_IPC_SYSLOG |
| 516 | if (circular_logging == TRUE ){ | 516 | if (circular_logging == TRUE ){ |
| 517 | ipcsyslog_init(); | 517 | ipcsyslog_init(); |
| 518 | } | 518 | } |
| 519 | #endif | 519 | #endif |
| 520 | 520 | ||
| 521 | #ifdef BB_FEATURE_REMOTE_LOG | 521 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 522 | if (doRemoteLog == TRUE){ | 522 | if (doRemoteLog == TRUE){ |
| 523 | init_RemoteLog(); | 523 | init_RemoteLog(); |
| 524 | } | 524 | } |
| @@ -585,7 +585,7 @@ extern int syslogd_main(int argc, char **argv) | |||
| 585 | case 'O': | 585 | case 'O': |
| 586 | logFilePath = strdup(optarg); | 586 | logFilePath = strdup(optarg); |
| 587 | break; | 587 | break; |
| 588 | #ifdef BB_FEATURE_REMOTE_LOG | 588 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 589 | case 'R': | 589 | case 'R': |
| 590 | RemoteHost = strdup(optarg); | 590 | RemoteHost = strdup(optarg); |
| 591 | if ( (p = strchr(RemoteHost, ':'))){ | 591 | if ( (p = strchr(RemoteHost, ':'))){ |
| @@ -598,7 +598,7 @@ extern int syslogd_main(int argc, char **argv) | |||
| 598 | local_logging = TRUE; | 598 | local_logging = TRUE; |
| 599 | break; | 599 | break; |
| 600 | #endif | 600 | #endif |
| 601 | #ifdef BB_FEATURE_IPC_SYSLOG | 601 | #ifdef CONFIG_FEATURE_IPC_SYSLOG |
| 602 | case 'C': | 602 | case 'C': |
| 603 | circular_logging = TRUE; | 603 | circular_logging = TRUE; |
| 604 | break; | 604 | break; |
| @@ -608,7 +608,7 @@ extern int syslogd_main(int argc, char **argv) | |||
| 608 | } | 608 | } |
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | #ifdef BB_FEATURE_REMOTE_LOG | 611 | #ifdef CONFIG_FEATURE_REMOTE_LOG |
| 612 | /* If they have not specified remote logging, then log locally */ | 612 | /* If they have not specified remote logging, then log locally */ |
| 613 | if (doRemoteLog == FALSE) | 613 | if (doRemoteLog == FALSE) |
| 614 | local_logging = TRUE; | 614 | local_logging = TRUE; |
