diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-20 15:26:56 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-20 15:26:56 +0000 |
commit | 95c633c4f926f9a795d048bc6e68b877e88ce1e9 (patch) | |
tree | 80d9c40889a3b296ac68728c670cd46b4bd89609 /sbin | |
parent | fb5981774ca1f9fe957d3dc6668ceee0e4116e80 (diff) |
Make ENXIO from SIOCGWAVELAN a fatal error so we don't get garbage
when wicontrol is run on a non-existant interface.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/wicontrol/wicontrol.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/wicontrol/wicontrol.c b/sbin/wicontrol/wicontrol.c index 651c38a2f27..fef33062f3f 100644 --- a/sbin/wicontrol/wicontrol.c +++ b/sbin/wicontrol/wicontrol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wicontrol.c,v 1.52 2004/07/15 16:56:18 millert Exp $ */ +/* $OpenBSD: wicontrol.c,v 1.53 2004/07/20 15:26:55 millert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -68,7 +68,7 @@ static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\ Bill Paul. All rights reserved."; static const char rcsid[] = - "@(#) $OpenBSD: wicontrol.c,v 1.52 2004/07/15 16:56:18 millert Exp $"; + "@(#) $OpenBSD: wicontrol.c,v 1.53 2004/07/20 15:26:55 millert Exp $"; #endif int wi_getval(char *, struct wi_req *); @@ -120,8 +120,11 @@ wi_getval(char *iface, struct wi_req *wreq) break; } - if (error == -1) + if (error == -1) { warn("SIOCGWAVELAN (0x%x)", wreq->wi_type); + if (errno == ENXIO) + exit(1); + } close(s); return (error); } |