summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2004-10-27 21:39:05 +0000
committerdamien <damien@openbsd.org>2004-10-27 21:39:05 +0000
commit1ad3249b8ccc47ae09378b7f964fa9749e07a4c2 (patch)
treedb7b99a031d315966797c585d815c0a3f63cdad8
parent- Remove unused variables declarations (diff)
downloadwireguard-openbsd-1ad3249b8ccc47ae09378b7f964fa9749e07a4c2.tar.xz
wireguard-openbsd-1ad3249b8ccc47ae09378b7f964fa9749e07a4c2.zip
It is no longer necessary to check ioctls SIOCGRADIO and SIOCGTABLE0
against ENOTTY because iwi can now report statistics and radio transmitter state at any time
-rw-r--r--sbin/iwicontrol/iwicontrol.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sbin/iwicontrol/iwicontrol.c b/sbin/iwicontrol/iwicontrol.c
index 966145da0f9..993d55409b3 100644
--- a/sbin/iwicontrol/iwicontrol.c
+++ b/sbin/iwicontrol/iwicontrol.c
@@ -1,4 +1,4 @@
-/* $Id: iwicontrol.c,v 1.4 2004/10/24 11:50:47 deraadt Exp $ */
+/* $Id: iwicontrol.c,v 1.5 2004/10/27 21:39:05 damien Exp $ */
/*-
* Copyright (c) 2004
@@ -95,6 +95,7 @@ main(int argc, char **argv)
if (!ifspecified)
iface = optarg;
break;
+
case 'd':
path = optarg;
break;
@@ -232,12 +233,8 @@ get_radio_state(char *iface)
{
int radio;
- if (do_req(iface, SIOCGRADIO, &radio) == -1) {
- if (errno == ENOTTY)
- errx(EX_OSERR, "Can't read radio: no firmware");
- else
- err(EX_OSERR, "Can't read radio");
- }
+ if (do_req(iface, SIOCGRADIO, &radio) == -1)
+ err(EX_OSERR, "Can't read radio");
(void)printf("Radio is %s\n", radio ? "ON" : "OFF");
}
@@ -310,12 +307,8 @@ get_statistics(char *iface)
static unsigned long stats[256]; /* XXX */
const struct statistic *stat;
- if (do_req(iface, SIOCGTABLE0, stats) == -1) {
- if (errno == ENOTTY)
- errx(EX_OSERR, "Can't read statistics: no firmware");
- else
- err(EX_OSERR, "Can't read statistics");
- }
+ if (do_req(iface, SIOCGTABLE0, stats) == -1)
+ err(EX_OSERR, "Can't read statistics");
for (stat = tbl; stat->index != 0; stat++)
(void)printf("%-60s[%lu]\n", stat->desc, stats[stat->index]);