--- libconsole.c +++ libconsole.c 2010-10-29 15:16:44.691925956 +0000 @@ -707,11 +707,12 @@ static void parselog(unsigned char *buf, static void copylog(const unsigned char *buf, const size_t s) { lock(&llock); - if (!nl) { + if (!nl) addlog('\n'); - nl = 1; - } storelog(buf, s); + if (buf[s-1] != '\n') + addlog('\n'); + nl = 1; unlock(&llock); } @@ -770,7 +771,7 @@ void prepareIO(void (*rfunc)(int), void (void)mkfifo(fifo_name, 0600); errno = 0; if (!stat(fifo_name, &st) && S_ISFIFO(st.st_mode)) { - if ((fdfifo = open(fifo_name, O_RDONLY|O_NOCTTY|O_CLOEXEC)) < 0) + if ((fdfifo = open(fifo_name, O_RDWR|O_NOCTTY|O_CLOEXEC)) < 0) warn("can not open named fifo %s: %s\n", fifo_name, strerror(errno)); } }