diff --git a/doc/Changelog b/doc/Changelog index 9a9c63c..4a564e1 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 Sun, 12 Jul 2009 19:58:10 +0200 diff --git a/src/bootlogd.c b/src/bootlogd.c index e2eb4d8..6091e21 100644 --- a/src/bootlogd.c +++ b/src/bootlogd.c @@ -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;