diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-04-05 20:55:17 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-04-05 20:55:17 +0000 |
commit | ea9065072c91b6397cb3cb597f248d23415169f0 (patch) | |
tree | 443da5367b2e6197a4412eb2eff56e269ce33338 /sysklogd | |
parent | 79359d87e86963607ea11dddd9b18cb43896b765 (diff) | |
download | busybox-w32-ea9065072c91b6397cb3cb597f248d23415169f0.tar.gz busybox-w32-ea9065072c91b6397cb3cb597f248d23415169f0.tar.bz2 busybox-w32-ea9065072c91b6397cb3cb597f248d23415169f0.zip |
Some cleanups/fixes for the syslogd circular buffer code
from Gennady Feldman.
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/syslogd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index e83ce48ae..6aec78b4e 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -119,7 +119,7 @@ static inline void sem_up(int semid) | |||
119 | */ | 119 | */ |
120 | static inline void sem_down(int semid) | 120 | static inline void sem_down(int semid) |
121 | { | 121 | { |
122 | if ( semop(semid, SMwdn, 2) == -1 ) | 122 | if ( semop(semid, SMwdn, 3) == -1 ) |
123 | perror_msg_and_die("semop[SMwdn]"); | 123 | perror_msg_and_die("semop[SMwdn]"); |
124 | } | 124 | } |
125 | 125 | ||
@@ -155,6 +155,8 @@ void ipcsyslog_init(void){ | |||
155 | perror_msg_and_die("semget"); | 155 | perror_msg_and_die("semget"); |
156 | }else | 156 | }else |
157 | perror_msg_and_die("semget"); | 157 | perror_msg_and_die("semget"); |
158 | } else { | ||
159 | sem_up(s_semid); | ||
158 | } | 160 | } |
159 | }else{ | 161 | }else{ |
160 | printf("Buffer already allocated just grab the semaphore?"); | 162 | printf("Buffer already allocated just grab the semaphore?"); |
@@ -514,6 +516,12 @@ static void doSyslogd (void) | |||
514 | FD_ZERO (&fds); | 516 | FD_ZERO (&fds); |
515 | FD_SET (sock_fd, &fds); | 517 | FD_SET (sock_fd, &fds); |
516 | 518 | ||
519 | #ifdef BB_FEATURE_IPC_SYSLOG | ||
520 | if (circular_logging == TRUE ){ | ||
521 | ipcsyslog_init(); | ||
522 | } | ||
523 | #endif | ||
524 | |||
517 | #ifdef BB_FEATURE_REMOTE_LOG | 525 | #ifdef BB_FEATURE_REMOTE_LOG |
518 | if (doRemoteLog == TRUE){ | 526 | if (doRemoteLog == TRUE){ |
519 | init_RemoteLog(); | 527 | init_RemoteLog(); |
@@ -619,12 +627,6 @@ extern int syslogd_main(int argc, char **argv) | |||
619 | 627 | ||
620 | umask(0); | 628 | umask(0); |
621 | 629 | ||
622 | #ifdef BB_FEATURE_IPC_SYSLOG | ||
623 | if (circular_logging == TRUE ){ | ||
624 | ipcsyslog_init(); | ||
625 | } | ||
626 | #endif | ||
627 | |||
628 | if (doFork == TRUE) { | 630 | if (doFork == TRUE) { |
629 | if (daemon(0, 1) < 0) | 631 | if (daemon(0, 1) < 0) |
630 | perror_msg_and_die("daemon"); | 632 | perror_msg_and_die("daemon"); |