aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/Config.in6
-rw-r--r--sysklogd/Makefile2
-rw-r--r--sysklogd/Makefile.in2
-rw-r--r--sysklogd/klogd.c4
-rw-r--r--sysklogd/logger.c14
-rw-r--r--sysklogd/logread.c28
-rw-r--r--sysklogd/syslogd.c2
7 files changed, 29 insertions, 29 deletions
diff --git a/sysklogd/Config.in b/sysklogd/Config.in
index a671f59f1..f77d79e8c 100644
--- a/sysklogd/Config.in
+++ b/sysklogd/Config.in
@@ -79,10 +79,10 @@ config CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
79 default n 79 default n
80 depends on CONFIG_LOGREAD 80 depends on CONFIG_LOGREAD
81 help 81 help
82 'logread' ouput to slow serial terminals can have 82 'logread' ouput to slow serial terminals can have
83 side effects on syslog because of the semaphore. 83 side effects on syslog because of the semaphore.
84 This option make logread to double buffer copy 84 This option make logread to double buffer copy
85 from circular buffer, minimizing semaphore 85 from circular buffer, minimizing semaphore
86 contention at some minor memory expense. 86 contention at some minor memory expense.
87 87
88config CONFIG_KLOGD 88config CONFIG_KLOGD
diff --git a/sysklogd/Makefile b/sysklogd/Makefile
index 0c01f546f..f6ce14530 100644
--- a/sysklogd/Makefile
+++ b/sysklogd/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 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 6# it under the terms of the GNU General Public License as published by
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
index d088ae855..1c6e90774 100644
--- a/sysklogd/Makefile.in
+++ b/sysklogd/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 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 6# it under the terms of the GNU General Public License as published by
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index df3a668dd..94da61658 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -6,7 +6,7 @@
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-2003 by Erik Andersen <andersen@codepoet.org> 9 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
10 * 10 *
11 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> 11 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
12 * 12 *
@@ -136,7 +136,7 @@ extern int klogd_main(int argc, char **argv)
136 bb_show_usage(); 136 bb_show_usage();
137 } 137 }
138 console_log_level++; 138 console_log_level++;
139 139
140 break; 140 break;
141 case 'n': 141 case 'n':
142 doFork = FALSE; 142 doFork = FALSE;
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 252cfc494..981cef322 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini logger implementation for busybox 3 * Mini logger implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -49,11 +49,11 @@
49# endif 49# endif
50#endif 50#endif
51 51
52/* Decode a symbolic name to a numeric value 52/* Decode a symbolic name to a numeric value
53 * this function is based on code 53 * this function is based on code
54 * Copyright (c) 1983, 1993 54 * Copyright (c) 1983, 1993
55 * The Regents of the University of California. All rights reserved. 55 * The Regents of the University of California. All rights reserved.
56 * 56 *
57 * Original copyright notice is retained at the end of this file. 57 * Original copyright notice is retained at the end of this file.
58 */ 58 */
59static int decode(char *name, CODE * codetab) 59static int decode(char *name, CODE * codetab)
@@ -71,7 +71,7 @@ static int decode(char *name, CODE * codetab)
71 return (-1); 71 return (-1);
72} 72}
73 73
74/* Decode a symbolic name to a numeric value 74/* Decode a symbolic name to a numeric value
75 * this function is based on code 75 * this function is based on code
76 * Copyright (c) 1983, 1993 76 * Copyright (c) 1983, 1993
77 * The Regents of the University of California. All rights reserved. 77 * The Regents of the University of California. All rights reserved.
@@ -132,7 +132,7 @@ extern int logger_main(int argc, char **argv)
132 do { 132 do {
133 /* read from stdin */ 133 /* read from stdin */
134 i = 0; 134 i = 0;
135 while ((c = getc(stdin)) != EOF && c != '\n' && 135 while ((c = getc(stdin)) != EOF && c != '\n' &&
136 i < (sizeof(buf)-1)) { 136 i < (sizeof(buf)-1)) {
137 buf[i++] = c; 137 buf[i++] = c;
138 } 138 }
@@ -180,8 +180,8 @@ extern int logger_main(int argc, char **argv)
180 * notice, this list of conditions and the following disclaimer in the 180 * notice, this list of conditions and the following disclaimer in the
181 * documentation and/or other materials provided with the distribution. 181 * documentation and/or other materials provided with the distribution.
182 * 182 *
183 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 183 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
184 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 184 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
185 * 185 *
186 * 4. Neither the name of the University nor the names of its contributors 186 * 4. Neither the name of the University nor the names of its contributors
187 * may be used to endorse or promote products derived from this software 187 * may be used to endorse or promote products derived from this software
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 207e78b57..70d1db631 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -62,13 +62,13 @@ static void interrupted(int sig);
62 */ 62 */
63static inline void sem_up(int semid) 63static inline void sem_up(int semid)
64{ 64{
65 if ( semop(semid, SMrup, 1) == -1 ) 65 if ( semop(semid, SMrup, 1) == -1 )
66 error_exit("semop[SMrup]"); 66 error_exit("semop[SMrup]");
67} 67}
68 68
69/* 69/*
70 * sem_down - down()'s a semaphore 70 * sem_down - down()'s a semaphore
71 */ 71 */
72static inline void sem_down(int semid) 72static inline void sem_down(int semid)
73{ 73{
74 if ( semop(semid, SMrdn, 2) == -1 ) 74 if ( semop(semid, SMrdn, 2) == -1 )
@@ -79,7 +79,7 @@ extern int logread_main(int argc, char **argv)
79{ 79{
80 int i; 80 int i;
81 int follow=0; 81 int follow=0;
82 82
83 if (argc == 2 && strcmp(argv[1],"-f")==0) { 83 if (argc == 2 && strcmp(argv[1],"-f")==0) {
84 follow = 1; 84 follow = 1;
85 } else { 85 } else {
@@ -87,16 +87,16 @@ extern int logread_main(int argc, char **argv)
87 if (argc > 1) 87 if (argc > 1)
88 bb_show_usage(); 88 bb_show_usage();
89 } 89 }
90 90
91 // handle intrrupt signal 91 // handle intrrupt signal
92 if (setjmp(jmp_env)) goto output_end; 92 if (setjmp(jmp_env)) goto output_end;
93 93
94 // attempt to redefine ^C signal 94 // attempt to redefine ^C signal
95 signal(SIGINT, interrupted); 95 signal(SIGINT, interrupted);
96 96
97 if ( (log_shmid = shmget(KEY_ID, 0, 0)) == -1) 97 if ( (log_shmid = shmget(KEY_ID, 0, 0)) == -1)
98 error_exit("Can't find circular buffer"); 98 error_exit("Can't find circular buffer");
99 99
100 // Attach shared memory to our char* 100 // Attach shared memory to our char*
101 if ( (buf = shmat(log_shmid, NULL, SHM_RDONLY)) == NULL) 101 if ( (buf = shmat(log_shmid, NULL, SHM_RDONLY)) == NULL)
102 error_exit("Can't get access to circular buffer from syslogd"); 102 error_exit("Can't get access to circular buffer from syslogd");
@@ -113,7 +113,7 @@ extern int logread_main(int argc, char **argv)
113 int log_len,j; 113 int log_len,j;
114#endif 114#endif
115 115
116 sem_down(log_semid); 116 sem_down(log_semid);
117 117
118 //printf("head: %i tail: %i size: %i\n",buf->head,buf->tail,buf->size); 118 //printf("head: %i tail: %i size: %i\n",buf->head,buf->tail,buf->size);
119 if (buf->head == buf->tail || i==buf->tail) { 119 if (buf->head == buf->tail || i==buf->tail) {
@@ -125,8 +125,8 @@ extern int logread_main(int argc, char **argv)
125 printf("<empty syslog>\n"); 125 printf("<empty syslog>\n");
126 } 126 }
127 } 127 }
128 128
129 // Read Memory 129 // Read Memory
130#ifdef CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING 130#ifdef CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
131 log_len = buf->tail - i; 131 log_len = buf->tail - i;
132 if (log_len < 0) 132 if (log_len < 0)
@@ -165,10 +165,10 @@ extern int logread_main(int argc, char **argv)
165 } while (follow); 165 } while (follow);
166 166
167output_end: 167output_end:
168 if (log_shmid != -1) 168 if (log_shmid != -1)
169 shmdt(buf); 169 shmdt(buf);
170 170
171 return EXIT_SUCCESS; 171 return EXIT_SUCCESS;
172} 172}
173 173
174static void interrupted(int sig){ 174static void interrupted(int sig){
@@ -179,7 +179,7 @@ static void interrupted(int sig){
179static void error_exit(const char *str){ 179static void error_exit(const char *str){
180 perror(str); 180 perror(str);
181 //release all acquired resources 181 //release all acquired resources
182 if (log_shmid != -1) 182 if (log_shmid != -1)
183 shmdt(buf); 183 shmdt(buf);
184 184
185 exit(1); 185 exit(1);
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index a533bce6b..ac326aa00 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini syslogd implementation for busybox 3 * Mini syslogd implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> 7 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
8 * 8 *