Sverre Froyen
2009-06-20 00:37:29 UTC
Hi,
There have been a couple of reports about wiconfig -D failing on USB devices
with the error given in the subject. See
http://mail-index.netbsd.org/tech-net/2008/03/17/msg000294.html
The problem is not a failed ioctl call but rather that an already set errno is
caught after the while loop in wi_apscan. Initializing errno before the loop
avoids the problem:
diff -u -r1.42 wiconfig.c
--- wiconfig.c 19 Apr 2009 01:52:09 -0000 1.42
+++ wiconfig.c 20 Jun 2009 00:01:19 -0000
@@ -201,6 +201,7 @@
printf("scanning ...");
fflush(stdout);
+ errno = 0;
while (ioctl(s, SIOCGWAVELAN, &ifr) == -1) {
retries--;
if (retries >= 0) {
Strangly, errno gets set by the printf("scanning...") statement just before
the loop.
Regards,
Sverre
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
There have been a couple of reports about wiconfig -D failing on USB devices
with the error given in the subject. See
http://mail-index.netbsd.org/tech-net/2008/03/17/msg000294.html
The problem is not a failed ioctl call but rather that an already set errno is
caught after the while loop in wi_apscan. Initializing errno before the loop
avoids the problem:
diff -u -r1.42 wiconfig.c
--- wiconfig.c 19 Apr 2009 01:52:09 -0000 1.42
+++ wiconfig.c 20 Jun 2009 00:01:19 -0000
@@ -201,6 +201,7 @@
printf("scanning ...");
fflush(stdout);
+ errno = 0;
while (ioctl(s, SIOCGWAVELAN, &ifr) == -1) {
retries--;
if (retries >= 0) {
Strangly, errno gets set by the printf("scanning...") statement just before
the loop.
Regards,
Sverre
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de