summaryrefslogtreecommitdiff
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2020-01-30 21:18:00 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2020-01-30 21:18:00 +0000
commit7952153695b9ff811fb07a80627e6a3bba1cd339 (patch)
tree29c2bf7f9c1defd451b3d19e0db7eefb4c163665 /sys/net/if_tun.c
parent994e02e31ce9206fc2de2429d47acdcb9d27369f (diff)
device poll handlers should return POLL flags, not errnos.
this restores restores returning POLLERR when the device is gone. ENXIO doesn't make much sense as part of a pollfd revents field.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 7497db8cfea..aca4b98e063 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.215 2020/01/28 16:26:09 visa Exp $ */
+/* $OpenBSD: if_tun.c,v 1.216 2020/01/30 21:17:59 dlg Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -941,7 +941,7 @@ tun_dev_poll(dev_t dev, int events, struct proc *p)
sc = tun_get(dev);
if (sc == NULL)
- return (ENXIO);
+ return (POLLERR);
ifp = &sc->sc_if;
revents = 0;