[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sysvinit-devel] bootlogd Tab Question

From: Marc Smith
Subject: [sysvinit-devel] bootlogd Tab Question
Date: Tue, 20 Jan 2015 12:16:07 -0500


I noticed an issue with bootlogd where lines beginning with a tab character are not written to the log file. In bootlogd.c I'm looking at lines 389 through 393... this snippet:

case '\t':
    line.pos += (line.pos / 8 + 1) * 8;
    if (line.pos >= (int)sizeof(line.buf))
        line.pos = sizeof(line.buf) - 1;

So when the character is a tab, we're advancing line.pos and we start writing the output to line.buf after this, but the problem is when we write the buffer to the file (fprintf() in line 412) we get nothing printed to the file since line.buf + 0 .. 7 is \0.

I don't understand the intention of this block of code, but I assume its so we don't print a tab character to the log file. Perhaps instead just print spaces (8 or 4 or X) to the file in-place of tabs?

I looked at the latest bootlogd.c from trunk ( and compared it to the version I'm using (2.88dsf) and it appears it would function the same. The line numbers I referenced above are taken from the trunk version.

Any help would be greatly appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]