ud3tn/components/daemon
Felix Walter b93c4250de OPS-SAT: daemon: Force line-buffering for stdout and stderr
This sets the line-buffered mode for the stdout and stderr streams right
at the start of the uD3TN daemon, preventing the loss of debug messages
in the output.

In the future we should implement this via a commandline parameter such
as provided for e.g. tcpdump. Though, it is important to not send any
output to stdout and stderr before issuing the setlinebuf call to be
conformant with C99:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf, p. 274 (PDF: 286)
> The setvbuf function may be used only after the stream pointed to by stream
> has been associated with an open file and before any other operation (other
> than an unsuccessful call to setvbuf) is performed on the stream.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2021-11-17 15:02:12 +01:00
..
main.c OPS-SAT: daemon: Force line-buffering for stdout and stderr 2021-11-17 15:02:12 +01:00