Clean up debug prints to use wpa_printf()

This converts most of the remaining perror() and printf() calls from
hostapd and wpa_supplicant to use wpa_printf().

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-12-24 12:43:35 +02:00
parent cad9b88be2
commit a193231dfb
22 changed files with 315 additions and 220 deletions

View file

@ -232,12 +232,8 @@ int random_pool_ready(void)
*/
fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
if (fd < 0) {
#ifndef CONFIG_NO_STDOUT_DEBUG
int error = errno;
perror("open(/dev/random)");
wpa_printf(MSG_ERROR, "random: Cannot open /dev/random: %s",
strerror(error));
#endif /* CONFIG_NO_STDOUT_DEBUG */
strerror(errno));
return -1;
}
@ -417,12 +413,8 @@ void random_init(const char *entropy_file)
random_fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
if (random_fd < 0) {
#ifndef CONFIG_NO_STDOUT_DEBUG
int error = errno;
perror("open(/dev/random)");
wpa_printf(MSG_ERROR, "random: Cannot open /dev/random: %s",
strerror(error));
#endif /* CONFIG_NO_STDOUT_DEBUG */
strerror(errno));
return;
}
wpa_printf(MSG_DEBUG, "random: Trying to read entropy from "