hostapd: Set stdout line-buffered

If hostapd will use stdout for debugging, set stdout to be line
buffered in case its output is redirected to a file. This allows
incremental output to be viewed immediately instead of at the file
buffering interval.

Signed-hostap: Paul Stewart <pstew@chromium.org>
This commit is contained in:
Paul Stewart 2014-12-04 14:23:35 -08:00 committed by Jouni Malinen
parent a642a52b17
commit de27bc7673
3 changed files with 12 additions and 0 deletions

View file

@ -574,6 +574,14 @@ void wpa_debug_close_file(void)
#endif /* CONFIG_DEBUG_FILE */
}
void wpa_debug_setup_stdout(void)
{
#ifndef _WIN32
setvbuf(stdout, NULL, _IOLBF, 0);
#endif /* _WIN32 */
}
#endif /* CONFIG_NO_STDOUT_DEBUG */