gpiomon: add option to set line buffered output
Some applications call gpiomon in a sub process, in which case glibc
defaults to block buffered output on stdout. This makes the output
arrive to the calling process only when the (4kB) buffer is filled (or
when gpiomon exists), making the information obsolete and pretty much
useless.
Support such scenarios by adding a switch to configure line buffered
output on stdout. Similar switches are available in other applications
(e.g. `rsync`s --output argument).
Signed-off-by: Martin Hundebøll <martin@geanix.com>
[Bartosz:
- use setlinebuf() instead of setvbuf(),
- tweak the help string,
- move the setlinebuf() call directly into the optarg switch statement]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>