summaryrefslogtreecommitdiff
path: root/src/rc/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-06 16:21:16 +0000
committerRoy Marples <roy@marples.name>2008-05-06 16:21:16 +0000
commit5ae702339e6e2e6a4921aad4dd923f5d20492a53 (patch)
tree73716cbd89de9dfdcde1bf558f0a02b22a59ee76 /src/rc/rc.c
parentd384502e57ba25f5c97e5badd8113d92447f1d8f (diff)
downloadopenrc-5ae702339e6e2e6a4921aad4dd923f5d20492a53.tar.gz
openrc-5ae702339e6e2e6a4921aad4dd923f5d20492a53.tar.bz2
openrc-5ae702339e6e2e6a4921aad4dd923f5d20492a53.tar.xz
We don't need to handle SIGWINCH in sysinit, so this should fix loading a framebuffer module in init.sh (Gentoo #219929. Ideally someone should tell me why this is happening and if there is a better fix.
Diffstat (limited to 'src/rc/rc.c')
-rw-r--r--src/rc/rc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 9429287..c1bc97e 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -146,7 +146,7 @@ static void cleanup(void)
rc_plugin_unload();
if (! rc_in_plugin && termios_orig) {
- tcsetattr(fileno(stdin), TCSANOW, termios_orig);
+ tcsetattr(STDIN_FILENO, TCSANOW, termios_orig);
free(termios_orig);
}
@@ -215,7 +215,7 @@ static char read_key(bool block)
{
struct termios termios;
char c = 0;
- int fd = fileno(stdin);
+ int fd = STDIN_FILENO;
if (! isatty(fd))
return false;
@@ -308,7 +308,7 @@ static void run_program(const char *prog)
sigprocmask(SIG_SETMASK, &old, NULL);
if (termios_orig)
- tcsetattr(fileno(stdin), TCSANOW, termios_orig);
+ tcsetattr(STDIN_FILENO, TCSANOW, termios_orig);
execl(prog, prog, (char *) NULL);
eerror("%s: unable to exec `%s': %s", applet, prog,
@@ -614,7 +614,7 @@ static void do_coldplug(void)
if (coldplugged_services)
TAILQ_FOREACH(s, coldplugged_services, entries)
printf(" %s", s->value);
- printf ("%s\n", ecolor(ECOLOR_NORMAL));
+ printf("%s\n", ecolor(ECOLOR_NORMAL));
}
static void do_newlevel(const char *newlevel)
@@ -635,6 +635,13 @@ static void do_newlevel(const char *newlevel)
{
/* OK, we're either in runlevel 1 or single user mode */
+ /* We don't want to trap SIGWINCH here as when a framebuffer
+ * driver is loaded by udev and we start using it then we
+ * race for some reason with the below scripts.
+ * This is fine as we only really need SIGWINCH for tidy
+ * output when using the logger. */
+ signal_setup(SIGWINCH, SIG_DFL);
+
/* exec init-early.sh if it exists
* This should just setup the console to use the correct
* font. Maybe it should setup the keyboard too? */