wpa_supplicant-flush-debug-output.patch 1016 B

123456789101112131415161718192021222324252627282930313233343536
  1. --- a/src/utils/wpa_debug.c
  2. +++ b/src/utils/wpa_debug.c
  3. @@ -79,6 +79,7 @@ void wpa_debug_print_timestamp(void)
  4. if (out_file)
  5. fprintf(out_file, "%ld.%06u: ", (long) tv.sec,
  6. (unsigned int) tv.usec);
  7. + fflush(out_file);
  8. #endif /* CONFIG_DEBUG_FILE */
  9. if (!out_file && !wpa_debug_syslog)
  10. printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec);
  11. @@ -230,6 +231,7 @@ void wpa_printf(int level, const char *f
  12. va_start(ap, fmt);
  13. vfprintf(out_file, fmt, ap);
  14. fprintf(out_file, "\n");
  15. + fflush(out_file);
  16. va_end(ap);
  17. }
  18. #endif /* CONFIG_DEBUG_FILE */
  19. @@ -365,6 +367,7 @@ static void _wpa_hexdump(int level, cons
  20. fprintf(out_file, " [REMOVED]");
  21. }
  22. fprintf(out_file, "\n");
  23. + fflush(out_file);
  24. }
  25. #endif /* CONFIG_DEBUG_FILE */
  26. if (!wpa_debug_syslog && !out_file) {
  27. @@ -468,6 +471,8 @@ static void _wpa_hexdump_ascii(int level
  28. }
  29. }
  30. file_done:
  31. + if (out_file)
  32. + fflush(out_file);
  33. #endif /* CONFIG_DEBUG_FILE */
  34. if (!wpa_debug_syslog && !out_file) {
  35. if (!show) {