Make sure bootlogd fflush() every line, even if asked not to flush

to disk using fdatasync().  Patch from Scott Gifford via Debian.
This commit is contained in:
Petter Reinholdtsen 2009-11-22 22:23:14 +00:00
parent 8debc401f8
commit 5da772c28f
2 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,8 @@ sysvinit (2.88dsf) UNRELEASED; urgency=low
Patch from Debian.
* Make sure bootlogd findpty() returns an error value when it fails to
find a usable pty. Patch from Rob Leslie via Debian.
* Make sure bootlogd fflush() every line, even if asked not to flush
to disk using fdatasync(). Patch from Scott Gifford via Debian.
-- Petter Reinholdtsen <pere@hungry.com> Sun, 12 Jul 2009 19:58:10 +0200

View File

@ -375,7 +375,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
break;
case '\n':
didnl = 1;
dosync = syncalot;
dosync = 1;
break;
case '\t':
line.pos += (line.pos / 8 + 1) * 8;
@ -407,7 +407,9 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
if (dosync) {
fflush(fp);
fdatasync(fileno(fp));
if (syncalot) {
fdatasync(fileno(fp));
}
}
outptr += olen;