0ba93a
--- a/src/utils/wpa_debug.c
0ba93a
+++ b/src/utils/wpa_debug.c
0ba93a
@@ -79,6 +79,7 @@ void wpa_debug_print_timestamp(void)
0ba93a
 	if (out_file)
3c9634
 		fprintf(out_file, "%ld.%06u: ", (long) tv.sec,
3c9634
 			(unsigned int) tv.usec);
0ba93a
+	fflush(out_file);
3c9634
 #endif /* CONFIG_DEBUG_FILE */
0ba93a
 	if (!out_file && !wpa_debug_syslog)
0ba93a
 		printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec);
0ba93a
@@ -230,6 +231,7 @@ void wpa_printf(int level, const char *f
0ba93a
 			va_start(ap, fmt);
3c9634
 			vfprintf(out_file, fmt, ap);
3c9634
 			fprintf(out_file, "\n");
3c9634
+			fflush(out_file);
0ba93a
 			va_end(ap);
0ba93a
 		}
3c9634
 #endif /* CONFIG_DEBUG_FILE */
0ba93a
@@ -365,6 +367,7 @@ static void _wpa_hexdump(int level, cons
3c9634
 			fprintf(out_file, " [REMOVED]");
3c9634
 		}
3c9634
 		fprintf(out_file, "\n");
3c9634
+		fflush(out_file);
0ba93a
 	}
3c9634
 #endif /* CONFIG_DEBUG_FILE */
0ba93a
 	if (!wpa_debug_syslog && !out_file) {
0ba93a
@@ -468,6 +471,8 @@ static void _wpa_hexdump_ascii(int level
3c9634
 		}
0ba93a
 	}
0ba93a
 file_done:
0ba93a
+	if (out_file)
3c9634
+		fflush(out_file);
3c9634
 #endif /* CONFIG_DEBUG_FILE */
0ba93a
 	if (!wpa_debug_syslog && !out_file) {
0ba93a
 		if (!show) {