[prev in list] [next in list] [prev in thread] [next in thread] 

List:       util-linux-ng
Subject:    Re: [PATCH] hwclock: flush stdout in hwclock -c
From:       J William Piggott <elseifthen () gmx ! com>
Date:       2015-04-28 11:27:03
Message-ID: 553F6E87.8030303 () gmx ! com
[Download RAW message or body]



On 04/27/2015 05:42 PM, Alexey Galakhov wrote:
> On Mon, 27 Apr 2015 17:27:07 -0400
> J William Piggott <elseifthen@gmx.com> wrote:
> 
>> I do not understand what this patch accomplishes. stdout is line
>> buffered. All of hwclock -c output ends with \n, which flushes
>> the buffer. Then we flush it again with fflush? What am I missing?
> 
> stdout is line buffered only if it is not redirected.

Thanks for the explanation, I wasn't aware of that.

> Using the pipe
> symbol in shell to redirect the output i.e. to awk results in not
> flushing the buffer until it's full.
> 
> A quick test:
> $ hwclock -c | cat
> 
> 
> Regards,
> Alexey
> 
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic