]> git.ipfire.org Git - thirdparty/util-linux.git/commit
utmpdup: Ensure flushing when using follow flag
authorAndrew Shapiro <anshapiro@gmail.com>
Mon, 1 Mar 2021 18:18:27 +0000 (13:18 -0500)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Mar 2021 09:49:53 +0000 (10:49 +0100)
commitf3a7b057ac28adaaf81c503abab2d8731cdc9b0c
tree1bdaa2ce628b458ab6a7c9e03023a9aed221cf75
parent50cc633257aa0844dd01e9572d6b0ddbfb19f6d5
utmpdup: Ensure flushing when using follow flag

The following usages of utmpdump result in no output being flushed to the specified file because the default output buffering is fully buffered:

$ utmpdump --follow --output myOutputFile /var/log/utmp
$ utmpdump --follow /var/log/utmp > myOutputFile

This change configures line buffering for these scenarios so that output will be flushed after each log event.

Signed-off-by: Andrew Shapiro <anshapiro@gmail.com>
login-utils/utmpdump.c