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