utils: Fix bug where logging output would occasionally fail.
It turns out that when setting a file descriptor to nonblocking, if that
fd is stdin and connected to a tty, it also makes stdout nonblocking.
Which means that prints() would occasionally fail if the output buffer
was full.
Solve this by only making file descriptors temporarily nonblocking when
reading them. Since the application is single threaded, this means that
the bit is never set when subsequently doing a print.
Signed-off-by:
Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment