File wpa_supplicant-flush-debug-output.patch of Package wpa_supplicant

diff -ur BUILD/wpa_supplicant-0.6.3/src/utils/wpa_debug.c BUILD2/wpa_supplicant-0.6.3/src/utils/wpa_debug.c
--- BUILD/wpa_supplicant-0.6.3/src/utils/wpa_debug.c	2008-02-23 03:45:24.000000000 +0100
+++ BUILD2/wpa_supplicant-0.6.3/src/utils/wpa_debug.c	2008-08-04 11:39:05.000000000 +0200
@@ -39,6 +39,7 @@
 	if (out_file) {
 		fprintf(out_file, "%ld.%06u: ", (long) tv.sec,
 			(unsigned int) tv.usec);
+		fflush(out_file);
 	} else
 #endif /* CONFIG_DEBUG_FILE */
 	printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec);
@@ -67,6 +68,7 @@
 		if (out_file) {
 			vfprintf(out_file, fmt, ap);
 			fprintf(out_file, "\n");
+			fflush(out_file);
 		} else {
 #endif /* CONFIG_DEBUG_FILE */
 		vprintf(fmt, ap);
@@ -99,6 +101,7 @@
 			fprintf(out_file, " [REMOVED]");
 		}
 		fprintf(out_file, "\n");
+		fflush(out_file);
 	} else {
 #endif /* CONFIG_DEBUG_FILE */
 	printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
@@ -144,12 +147,14 @@
 			fprintf(out_file,
 				"%s - hexdump_ascii(len=%lu): [REMOVED]\n",
 				title, (unsigned long) len);
+			fflush(out_file);
 			return;
 		}
 		if (buf == NULL) {
 			fprintf(out_file,
 				"%s - hexdump_ascii(len=%lu): [NULL]\n",
 				title, (unsigned long) len);
+			fflush(out_file);
 			return;
 		}
 		fprintf(out_file, "%s - hexdump_ascii(len=%lu):\n",
@@ -174,6 +179,7 @@
 			pos += llen;
 			len -= llen;
 		}
+		fflush(out_file);
 	} else {
 #endif /* CONFIG_DEBUG_FILE */
 	if (!show) {