summaryrefslogtreecommitdiff
path: root/sys/net/switchctl.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2019-12-19 12:04:39 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2019-12-19 12:04:39 +0000
commitddf459ffdf2efda393006c0be35b7a90e6eca80f (patch)
tree94a0e90d3e9ec137651ff9072349080d302e1de0 /sys/net/switchctl.c
parent2c122dfca1e93c23d49f2782552a59cad4d32daa (diff)
poll handlers must return a poll(2) revents value, not errno(2) values.
Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in userland. Change it to POLLERR for now, but it might as well be POLLHUP. OK mpi@
Diffstat (limited to 'sys/net/switchctl.c')
-rw-r--r--sys/net/switchctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/switchctl.c b/sys/net/switchctl.c
index af63899e89a..7a8f746cc87 100644
--- a/sys/net/switchctl.c
+++ b/sys/net/switchctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchctl.c,v 1.16 2019/10/16 10:20:48 mpi Exp $ */
+/* $OpenBSD: switchctl.c,v 1.17 2019/12/19 12:04:38 reyk Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -361,7 +361,7 @@ switchpoll(dev_t dev, int events, struct proc *p)
struct switch_softc *sc = switch_dev2sc(dev);
if (sc == NULL)
- return (ENXIO);
+ return (POLLERR);
if (events & (POLLIN | POLLRDNORM)) {
if (!mq_empty(&sc->sc_swdev->swdev_outq) ||