wpa_supplicant/wpa_supplicant-errormsg.patch

18 lines
481 B
Diff
Raw Normal View History

--- driver_wext.c
+++ driver_wext.c
@@ -154,10 +154,12 @@ static int wpa_driver_wext_set_auth_para
iwr.u.param.value = value;
if (ioctl(drv->ioctl_sock, SIOCSIWAUTH, &iwr) < 0) {
- perror("ioctl[SIOCSIWAUTH]");
+ int saved_errno = errno;
fprintf(stderr, "WEXT auth param %d value 0x%x - ",
idx, value);
- ret = errno == EOPNOTSUPP ? -2 : -1;
+ errno = saved_errno;
+ perror("ioctl[SIOCSIWAUTH]");
+ ret = saved_errno == EOPNOTSUPP ? -2 : -1;
}
return ret;