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/syslogd.c | |
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/syslogd.c')
-rw-r--r-- | sysklogd/syslogd.c | 30 |
1 files changed, 15 insertions, 15 deletions
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; |