Do not mess with the console logging level unless

asked to do so.
 -Erik
This commit is contained in:
Eric Andersen 2004-06-25 11:23:03 +00:00
parent 774e6cc29c
commit 0373cf1396

View File

@ -51,8 +51,8 @@ static void klogd_signal(int sig)
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
static void doKlogd(const char console_log_level) __attribute__ ((noreturn)); static void doKlogd(const int console_log_level) __attribute__ ((noreturn));
static void doKlogd(const char console_log_level) static void doKlogd(const int console_log_level)
{ {
int priority = LOG_INFO; int priority = LOG_INFO;
char log_buffer[4096]; char log_buffer[4096];
@ -71,7 +71,7 @@ static void doKlogd(const char console_log_level)
klogctl(1, NULL, 0); klogctl(1, NULL, 0);
/* Set level of kernel console messaging.. */ /* Set level of kernel console messaging.. */
if (console_log_level) if (console_log_level != -1)
klogctl(8, NULL, console_log_level); klogctl(8, NULL, console_log_level);
syslog(LOG_NOTICE, "klogd started: " BB_BANNER); syslog(LOG_NOTICE, "klogd started: " BB_BANNER);
@ -83,7 +83,7 @@ static void doKlogd(const char console_log_level)
if (n < 0) { if (n < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
syslog(LOG_ERR, "klogd: Error return from sys_sycall: %d - %s.\n", errno, strerror(errno)); syslog(LOG_ERR, "klogd: Error return from sys_sycall: %d - %m.\n", errno);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -118,7 +118,7 @@ extern int klogd_main(int argc, char **argv)
/* no options, no getopt */ /* no options, no getopt */
int opt; int opt;
int doFork = TRUE; int doFork = TRUE;
unsigned char console_log_level = 7; unsigned char console_log_level = -1;
/* do normal option parsing */ /* do normal option parsing */
while ((opt = getopt(argc, argv, "c:n")) > 0) { while ((opt = getopt(argc, argv, "c:n")) > 0) {