File wpa_supplicant-errormsg.patch of Package wpa_supplicant

--- BUILD/wpa_supplicant-0.6.4/src/drivers/driver_wext.c
+++ BUILD/wpa_supplicant-0.6.4/src/drivers/driver_wext.c
@@ -228,12 +228,13 @@
 	iwr.u.param.value = value;
 
 	if (ioctl(drv->ioctl_sock, SIOCSIWAUTH, &iwr) < 0) {
+		int saved_errno = errno;
 		if (errno != EOPNOTSUPP) {
 			wpa_printf(MSG_DEBUG, "WEXT: SIOCSIWAUTH(param %d "
 				   "value 0x%x) failed: %s)",
 				   idx, value, strerror(errno));
 		}
-		ret = errno == EOPNOTSUPP ? -2 : -1;
+		ret = saved_errno == EOPNOTSUPP ? -2 : -1;
 	}
 
 	return ret;