diff --git a/showconsole-1.14.dif b/showconsole-1.14.dif index c9a155e..c88c368 100644 --- a/showconsole-1.14.dif +++ b/showconsole-1.14.dif @@ -127,7 +127,7 @@ .TP .I /dev/console --- libconsole.c -+++ libconsole.c 2011-04-19 11:59:52.812425484 +0000 ++++ libconsole.c 2011-04-19 12:16:38.307927219 +0000 @@ -59,6 +59,22 @@ #include "listing.h" @@ -307,7 +307,22 @@ error ("select(): %m\n"); goto nothing; } -@@ -998,20 +1019,14 @@ void closeIO(void) +@@ -898,8 +919,12 @@ void safeIO (void) + (*vr_access)(); + vr_access = NULL; + } +- if ((flog = fdopen (log, "a")) == NULL) +- error("Can not open %s: %m\n", BOOT_LOGFILE); ++ lock(&llock); ++ if ((flog = fdopen (log, "a")) == NULL) { ++ unlock(&llock); ++ error("Can not open %s: %m\n", BOOT_LOGFILE); ++ } ++ unlock(&llock); + + nsigio = SIGIO; /* We do not need a signal handler */ + (void)signal(SIGIO, SIG_IGN); +@@ -998,20 +1023,16 @@ void closeIO(void) pthread_cancel(lthread); } @@ -329,13 +344,15 @@ + fputc('\n', flog); + (void)fclose(flog); + } ++ lock(&llock); flog = NULL; -xout: ++ unlock(&llock); + if (fdfifo >= 0) { close(fdfifo); fdfifo = -1; -@@ -1101,7 +1116,7 @@ static dev_t fallback(const pid_t pid, c +@@ -1101,7 +1122,7 @@ static dev_t fallback(const pid_t pid, c printf("|%u|%u|", tty, ttypgrp); /* stdout to pipe synchronize ... */ @@ -344,7 +361,7 @@ } break; case -1: error("can not execute: %m\n"); -@@ -1463,6 +1478,10 @@ static void consalloc(struct console *re +@@ -1463,6 +1484,10 @@ static void consalloc(struct console *re return; } tail->next = newc;