LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ioctl.patch of Package hwinfo (Project home:npaxton)

--- ./src/hd/wlan.c.orig	2006-07-25 16:04:16.000000000 -0600
+++ ./src/hd/wlan.c	2006-07-25 16:07:19.000000000 -0600
@@ -1053,10 +1053,12 @@ static int wpa_driver_wext_set_wpa(const
 
 	s = socket(PF_INET, SOCK_DGRAM, 0);
 	if (s < 0) return -1;
-	
+
+#ifdef SIOCSIWAUTH	
 	if ((ret=ioctl(s, SIOCSIWAUTH, &iwr)) < 0) {
 		ret = -1;
 	}
+#endif
 	close(s);
 	return ret;
 }
@@ -1067,6 +1069,7 @@ static int wpa_driver_wext_set_auth_alg(
 	struct iwreq iwr;
 	int ret = 0;
 	int s;
+#ifdef IW_AUTH_ALG_OPEN_SYSTEM
 	
 	if (auth_alg & AUTH_ALG_OPEN_SYSTEM)
 		algs |= IW_AUTH_ALG_OPEN_SYSTEM;
@@ -1091,6 +1094,7 @@ static int wpa_driver_wext_set_auth_alg(
 		ret = -1;
 	}
 	close(s);
+#endif
 	return ret;
 }
 
@@ -1102,6 +1106,7 @@ static int wpa_driver_wext_set_key(const
 	struct iw_encode_ext *ext;
 	int ret = 0;
 	int s;
+#ifdef IW_ENCODE_ALG_NONE
 
 	if (seq_len > IW_ENCODE_SEQ_MAX_SIZE) {
 		return -1;
@@ -1165,6 +1170,7 @@ static int wpa_driver_wext_set_key(const
 	}
 	close(s);
 	free(ext);
+#endif
 	return ret;
 }