decouple INIT and SYSLOGD (patch by Eric Spakman E.Spakman@inter.nl.net)
This commit is contained in:
parent
1ccd96fd1f
commit
ccd412da09
@ -38,6 +38,11 @@ config FEATURE_INIT_SCTTY
|
|||||||
behavour, but is often what you want in an embedded system where
|
behavour, but is often what you want in an embedded system where
|
||||||
the console is only accessed during development or for maintenance.
|
the console is only accessed during development or for maintenance.
|
||||||
|
|
||||||
|
config FEATURE_INIT_SYSLOG
|
||||||
|
bool "Enable init to write to syslog"
|
||||||
|
default n
|
||||||
|
depends on INIT
|
||||||
|
|
||||||
config FEATURE_EXTRA_QUIET
|
config FEATURE_EXTRA_QUIET
|
||||||
bool "Be _extra_ quiet on boot"
|
bool "Be _extra_ quiet on boot"
|
||||||
default y
|
default y
|
||||||
|
10
init/init.c
10
init/init.c
@ -16,7 +16,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/reboot.h>
|
#include <sys/reboot.h>
|
||||||
|
|
||||||
#if ENABLE_SYSLOGD
|
#if ENABLE_FEATURE_INIT_SYSLOG
|
||||||
# include <sys/syslog.h>
|
# include <sys/syslog.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ struct init_action {
|
|||||||
/* Static variables */
|
/* Static variables */
|
||||||
static struct init_action *init_action_list = NULL;
|
static struct init_action *init_action_list = NULL;
|
||||||
|
|
||||||
#if !ENABLE_SYSLOGD
|
#if !ENABLE_FEATURE_INIT_SYSLOG
|
||||||
static const char *log_console = VC_5;
|
static const char *log_console = VC_5;
|
||||||
#endif
|
#endif
|
||||||
#if !ENABLE_DEBUG_INIT
|
#if !ENABLE_DEBUG_INIT
|
||||||
@ -144,7 +144,7 @@ static void message(int device, const char *fmt, ...)
|
|||||||
__attribute__ ((format(printf, 2, 3)));
|
__attribute__ ((format(printf, 2, 3)));
|
||||||
static void message(int device, const char *fmt, ...)
|
static void message(int device, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
#if !ENABLE_SYSLOGD
|
#if !ENABLE_FEATURE_INIT_SYSLOG
|
||||||
static int log_fd = -1;
|
static int log_fd = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ static void message(int device, const char *fmt, ...)
|
|||||||
msg[sizeof(msg) - 2] = '\0';
|
msg[sizeof(msg) - 2] = '\0';
|
||||||
l = strlen(msg);
|
l = strlen(msg);
|
||||||
|
|
||||||
#if ENABLE_SYSLOGD
|
#if ENABLE_FEATURE_INIT_SYSLOG
|
||||||
/* Log the message to syslogd */
|
/* Log the message to syslogd */
|
||||||
if (device & L_LOG) {
|
if (device & L_LOG) {
|
||||||
/* don't out "\r" */
|
/* don't out "\r" */
|
||||||
@ -285,7 +285,7 @@ static void console_init(void)
|
|||||||
* if TERM is set to linux (the default) */
|
* if TERM is set to linux (the default) */
|
||||||
if (!s || strcmp(s, "linux") == 0)
|
if (!s || strcmp(s, "linux") == 0)
|
||||||
putenv((char*)"TERM=vt102");
|
putenv((char*)"TERM=vt102");
|
||||||
#if !ENABLE_SYSLOGD
|
#if !ENABLE_FEATURE_INIT_SYSLOG
|
||||||
log_console = NULL;
|
log_console = NULL;
|
||||||
#endif
|
#endif
|
||||||
} else if (!s)
|
} else if (!s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user