[PATCH] obey CONFIG_DEBUG_NO_STDOUT in wpa_debug.c

Norman Hamer NHamer at absolute.com
Fri Oct 14 10:25:55 PDT 2022


diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index a338a2039..997deb3ba 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -80,8 +80,10 @@ void wpa_debug_print_timestamp(void)
 		fprintf(out_file, "%ld.%06u: ", (long) tv.sec,
 			(unsigned int) tv.usec);
 #endif /* CONFIG_DEBUG_FILE */
+#ifndef CONFIG_DEBUG_NO_STDOUT
 	if (!out_file && !wpa_debug_syslog)
 		printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec);
+#endif /* CONFIG_DEBUG_NO_STDOUT */
 #endif /* CONFIG_ANDROID_LOG */
 }
 
@@ -233,12 +235,14 @@ void wpa_printf(int level, const char *fmt, ...)
 			va_end(ap);
 		}
 #endif /* CONFIG_DEBUG_FILE */
+#ifndef CONFIG_DEBUG_NO_STDOUT
 		if (!wpa_debug_syslog && !out_file) {
 			va_start(ap, fmt);
 			vprintf(fmt, ap);
 			printf("\n");
 			va_end(ap);
 		}
+#endif /* CONFIG_DEBUG_NO_STDOUT */
 #endif /* CONFIG_ANDROID_LOG */
 	}
 
@@ -367,6 +371,7 @@ static void _wpa_hexdump(int level, const char *title, const u8 *buf,
 		fprintf(out_file, "\n");
 	}
 #endif /* CONFIG_DEBUG_FILE */
+#ifndef CONFIG_DEBUG_NO_STDOUT
 	if (!wpa_debug_syslog && !out_file) {
 		printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
 		if (buf == NULL) {
@@ -379,6 +384,7 @@ static void _wpa_hexdump(int level, const char *title, const u8 *buf,
 		}
 		printf("\n");
 	}
+#endif /* CONFIG_DEBUG_NO_STDOUT */
 #endif /* CONFIG_ANDROID_LOG */
 }
 
@@ -469,6 +475,7 @@ static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
 	}
 file_done:
 #endif /* CONFIG_DEBUG_FILE */
+#ifndef CONFIG_DEBUG_NO_STDOUT
 	if (!wpa_debug_syslog && !out_file) {
 		if (!show) {
 			printf("%s - hexdump_ascii(len=%lu): [REMOVED]\n",
@@ -503,6 +510,7 @@ file_done:
 			len -= llen;
 		}
 	}
+#endif /* CONFIG_DEBUG_NO_STDOUT */
 #endif /* CONFIG_ANDROID_LOG */
 }
 



More information about the Hostap mailing list