diff --git a/usr.sbin/wpa/ndis_events/ndis_events.c b/usr.sbin/wpa/ndis_events/ndis_events.c index c36106df8212..d2dedff779cd 100644 --- a/usr.sbin/wpa/ndis_events/ndis_events.c +++ b/usr.sbin/wpa/ndis_events/ndis_events.c @@ -192,11 +192,14 @@ announce_event(ifname, sock, dst) if (ioctl(s, SIOCGPRIVATE_0, &ifr) < 0) { close(s); - if (errno == ENOENT) - dbgmsg("drained all events from %s", ifname, errno); - else - dbgmsg("failed to read event info from %s: %d", - ifname, errno); + if (verbose) { + if (errno == ENOENT) + dbgmsg("drained all events from %s", + ifname, errno); + else + dbgmsg("failed to read event info from %s: %d", + ifname, errno); + } return(ENOENT); }