From 335f09726f5e21e3b3d594576a9acf7b1adcce0a Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 26 Feb 2015 18:47:43 +0100 Subject: [PATCH] conf.c: Slight update in TTY fallback behavior. If no tty is configured in finit.conf, only use FALLBACK_SHELL (usually /bin/sh on UNIX) when no console is configured either. Signed-off-by: Joachim Nilsson --- conf.c | 10 ++++++++-- finit.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conf.c b/conf.c index 393e1b3f..9a08be1c 100644 --- a/conf.c +++ b/conf.c @@ -275,8 +275,14 @@ int parse_finit_conf(char *file) rcsd = strdup(FINIT_RCSD); result = parse_conf(file); - if (!tty_num()) - tty_register(FALLBACK_SHELL); + if (!tty_num()) { + char *fallback = FALLBACK_SHELL; + + if (console) + fallback = console; + + tty_register(fallback); + } return result; } diff --git a/finit.h b/finit.h index c25ccc88..3790d8b8 100644 --- a/finit.h +++ b/finit.h @@ -54,6 +54,8 @@ # define HAVE_DBUS #endif +/* If the user configures us to not know about any getty use the system + * defined /bin/sh (or similar) as fallback for TTYs. */ #ifndef FALLBACK_SHELL # define FALLBACK_SHELL _PATH_BSHELL #endif