diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-05 19:55:30 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-05 19:55:30 +0000 |
| commit | ccd412da09d3d9ff54e14874c74c0a8dde6015b2 (patch) | |
| tree | ae9aad1d5ce1edd4ebc42d8e90b54f9b64c5192a /init | |
| parent | 1ccd96fd1f4aa038bb6e5c7419d04915c3586464 (diff) | |
| download | busybox-w32-ccd412da09d3d9ff54e14874c74c0a8dde6015b2.tar.gz busybox-w32-ccd412da09d3d9ff54e14874c74c0a8dde6015b2.tar.bz2 busybox-w32-ccd412da09d3d9ff54e14874c74c0a8dde6015b2.zip | |
decouple INIT and SYSLOGD (patch by Eric Spakman E.Spakman@inter.nl.net)
Diffstat (limited to 'init')
| -rw-r--r-- | init/Config.in | 5 | ||||
| -rw-r--r-- | init/init.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/init/Config.in b/init/Config.in index c0ad5263d..3987d8fee 100644 --- a/init/Config.in +++ b/init/Config.in | |||
| @@ -38,6 +38,11 @@ config FEATURE_INIT_SCTTY | |||
| 38 | behavour, but is often what you want in an embedded system where | 38 | behavour, but is often what you want in an embedded system where |
| 39 | the console is only accessed during development or for maintenance. | 39 | the console is only accessed during development or for maintenance. |
| 40 | 40 | ||
| 41 | config FEATURE_INIT_SYSLOG | ||
| 42 | bool "Enable init to write to syslog" | ||
| 43 | default n | ||
| 44 | depends on INIT | ||
| 45 | |||
| 41 | config FEATURE_EXTRA_QUIET | 46 | config FEATURE_EXTRA_QUIET |
| 42 | bool "Be _extra_ quiet on boot" | 47 | bool "Be _extra_ quiet on boot" |
| 43 | default y | 48 | default y |
diff --git a/init/init.c b/init/init.c index 698563228..02a33274a 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include <sys/wait.h> | 16 | #include <sys/wait.h> |
| 17 | #include <sys/reboot.h> | 17 | #include <sys/reboot.h> |
| 18 | 18 | ||
| 19 | #if ENABLE_SYSLOGD | 19 | #if ENABLE_FEATURE_INIT_SYSLOG |
| 20 | # include <sys/syslog.h> | 20 | # include <sys/syslog.h> |
| 21 | #endif | 21 | #endif |
| 22 | 22 | ||
| @@ -84,7 +84,7 @@ struct init_action { | |||
| 84 | /* Static variables */ | 84 | /* Static variables */ |
| 85 | static struct init_action *init_action_list = NULL; | 85 | static struct init_action *init_action_list = NULL; |
| 86 | 86 | ||
| 87 | #if !ENABLE_SYSLOGD | 87 | #if !ENABLE_FEATURE_INIT_SYSLOG |
| 88 | static const char *log_console = VC_5; | 88 | static const char *log_console = VC_5; |
| 89 | #endif | 89 | #endif |
| 90 | #if !ENABLE_DEBUG_INIT | 90 | #if !ENABLE_DEBUG_INIT |
| @@ -144,7 +144,7 @@ static void message(int device, const char *fmt, ...) | |||
| 144 | __attribute__ ((format(printf, 2, 3))); | 144 | __attribute__ ((format(printf, 2, 3))); |
| 145 | static void message(int device, const char *fmt, ...) | 145 | static void message(int device, const char *fmt, ...) |
| 146 | { | 146 | { |
| 147 | #if !ENABLE_SYSLOGD | 147 | #if !ENABLE_FEATURE_INIT_SYSLOG |
| 148 | static int log_fd = -1; | 148 | static int log_fd = -1; |
| 149 | #endif | 149 | #endif |
| 150 | 150 | ||
| @@ -159,7 +159,7 @@ static void message(int device, const char *fmt, ...) | |||
| 159 | msg[sizeof(msg) - 2] = '\0'; | 159 | msg[sizeof(msg) - 2] = '\0'; |
| 160 | l = strlen(msg); | 160 | l = strlen(msg); |
| 161 | 161 | ||
| 162 | #if ENABLE_SYSLOGD | 162 | #if ENABLE_FEATURE_INIT_SYSLOG |
| 163 | /* Log the message to syslogd */ | 163 | /* Log the message to syslogd */ |
| 164 | if (device & L_LOG) { | 164 | if (device & L_LOG) { |
| 165 | /* don't out "\r" */ | 165 | /* don't out "\r" */ |
| @@ -285,7 +285,7 @@ static void console_init(void) | |||
| 285 | * if TERM is set to linux (the default) */ | 285 | * if TERM is set to linux (the default) */ |
| 286 | if (!s || strcmp(s, "linux") == 0) | 286 | if (!s || strcmp(s, "linux") == 0) |
| 287 | putenv((char*)"TERM=vt102"); | 287 | putenv((char*)"TERM=vt102"); |
| 288 | #if !ENABLE_SYSLOGD | 288 | #if !ENABLE_FEATURE_INIT_SYSLOG |
| 289 | log_console = NULL; | 289 | log_console = NULL; |
| 290 | #endif | 290 | #endif |
| 291 | } else if (!s) | 291 | } else if (!s) |
