From cda47593c46bae82731a3ace441426d8628dd815 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 1 Nov 2006 03:37:25 +0000 Subject: poll errors should be POLLERR, not some random E value from alexandre ratchov. ok claudio --- sys/dev/audio.c | 6 +++--- sys/dev/cons.c | 5 +++-- sys/dev/midi.c | 4 ++-- sys/dev/usb/ugen.c | 10 +++++----- sys/dev/usb/uhid.c | 4 ++-- sys/dev/usb/usb.c | 4 ++-- sys/dev/usb/uscanner.c | 4 ++-- sys/dev/wscons/wsdisplay.c | 7 ++++--- sys/dev/wscons/wsmouse.c | 5 +++-- sys/dev/wscons/wsmux.c | 5 +++-- sys/net/if_tun.c | 4 ++-- 11 files changed, 31 insertions(+), 27 deletions(-) (limited to 'sys') diff --git a/sys/dev/audio.c b/sys/dev/audio.c index d2af628802c..f0910188706 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.51 2006/06/23 06:27:11 miod Exp $ */ +/* $OpenBSD: audio.c,v 1.52 2006/11/01 03:37:23 tedu Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -769,10 +769,10 @@ audiopoll(dev, events, p) if (unit >= audio_cd.cd_ndevs || (sc = audio_cd.cd_devs[unit]) == NULL) - return ENXIO; + return POLLERR; if (sc->sc_dying) - return (EIO); + return POLLERR; sc->sc_refcnt ++; switch (AUDIODEV(dev)) { diff --git a/sys/dev/cons.c b/sys/dev/cons.c index b9130b402bf..317d52f6cef 100644 --- a/sys/dev/cons.c +++ b/sys/dev/cons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cons.c,v 1.16 2005/12/31 21:22:34 miod Exp $ */ +/* $OpenBSD: cons.c,v 1.17 2006/11/01 03:37:23 tedu Exp $ */ /* $NetBSD: cons.c,v 1.30 1996/04/08 19:57:30 jonathan Exp $ */ /* @@ -49,6 +49,7 @@ #include #include #include +#include #include @@ -217,7 +218,7 @@ cnpoll(dev, rw, p) if (constty != NULL) dev = constty->t_dev; else if (cn_tab == NULL) - return ENXIO; + return POLLERR; else dev = cn_tab->cn_dev; return (ttpoll(cn_tab->cn_dev, rw, p)); diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 4f1cb931a9c..35dc9e8bb27 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.14 2006/04/16 03:24:27 jsg Exp $ */ +/* $OpenBSD: midi.c,v 1.15 2006/11/01 03:37:23 tedu Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -350,7 +350,7 @@ midipoll(dev_t dev, int events, struct proc *p) int s, revents; if (sc->isdying) - return EIO; + return POLLERR; revents = 0; s = splaudio(); diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 1c503715fd6..550993081d1 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.35 2006/06/23 06:27:11 miod Exp $ */ +/* $OpenBSD: ugen.c,v 1.36 2006/11/01 03:37:23 tedu Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -1347,20 +1347,20 @@ ugenpoll(dev_t dev, int events, usb_proc_ptr p) USB_GET_SC(ugen, UGENUNIT(dev), sc); if (sc->sc_dying) - return (EIO); + return (POLLERR); /* XXX always IN */ sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN]; if (sce == NULL) - return (EINVAL); + return (POLLERR); #ifdef DIAGNOSTIC if (!sce->edesc) { printf("ugenpoll: no edesc\n"); - return (EIO); + return (POLLERR); } if (!sce->pipeh) { printf("ugenpoll: no pipe\n"); - return (EIO); + return (POLLERR); } #endif s = splusb(); diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index dfda586c832..73d6c167b08 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.29 2006/06/23 06:27:11 miod Exp $ */ +/* $OpenBSD: uhid.c,v 1.30 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -549,7 +549,7 @@ uhidpoll(dev_t dev, int events, usb_proc_ptr p) USB_GET_SC(uhid, UHIDUNIT(dev), sc); if (sc->sc_dying) - return (EIO); + return (POLLERR); s = splusb(); if (events & (POLLOUT | POLLWRNORM)) diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 47ce2e4dd3c..ed01a21d29b 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.34 2006/09/18 10:55:51 dlg Exp $ */ +/* $OpenBSD: usb.c,v 1.35 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -595,7 +595,7 @@ usbpoll(dev_t dev, int events, usb_proc_ptr p) return (revents); } else { - return (ENXIO); + return (POLLERR); } } diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c index 3fe6035305f..e253c3265e5 100644 --- a/sys/dev/usb/uscanner.c +++ b/sys/dev/usb/uscanner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uscanner.c,v 1.21 2006/07/01 10:33:12 miod Exp $ */ +/* $OpenBSD: uscanner.c,v 1.22 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $ */ /* @@ -693,7 +693,7 @@ uscannerpoll(dev_t dev, int events, usb_proc_ptr p) USB_GET_SC(uscanner, USCANNERUNIT(dev), sc); if (sc->sc_dying) - return (EIO); + return (POLLERR); /* * We have no easy way of determining if a read will diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 7c2cdb9d757..5112dbc5880 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.69 2006/08/05 16:59:57 miod Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.70 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -1343,10 +1344,10 @@ wsdisplaypoll(dev_t dev, int events, struct proc *p) return (0); if ((scr = sc->sc_scr[WSDISPLAYSCREEN(dev)]) == NULL) - return (ENXIO); + return (POLLERR); if (!WSSCREEN_HAS_TTY(scr)) - return (ENODEV); + return (POLLERR); return (ttpoll(dev, events, p)); } diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c index 2cd1358c81e..14c7a321dcb 100644 --- a/sys/dev/wscons/wsmouse.c +++ b/sys/dev/wscons/wsmouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmouse.c,v 1.17 2005/08/14 11:00:15 miod Exp $ */ +/* $OpenBSD: wsmouse.c,v 1.18 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */ /* @@ -91,6 +91,7 @@ #include #include #include +#include #include #include @@ -640,7 +641,7 @@ wsmousepoll(dev_t dev, int events, struct proc *p) struct wsmouse_softc *sc = wsmouse_cd.cd_devs[minor(dev)]; if (sc->sc_base.me_evp == NULL) - return (EINVAL); + return (POLLERR); return (wsevent_poll(sc->sc_base.me_evp, events, p)); } diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index a8913e7ea48..8ba12358b71 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.18 2006/08/05 19:08:41 miod Exp $ */ +/* $OpenBSD: wsmux.c,v 1.19 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -547,7 +548,7 @@ wsmuxpoll(dev_t dev, int events, struct proc *p) #ifdef DIAGNOSTIC printf("wsmuxpoll: not open\n"); #endif - return (EACCES); + return (POLLERR); } return (wsevent_poll(sc->sc_base.me_evp, events, p)); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index a11b0e8ada0..ee1094196db 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.79 2006/03/25 22:41:48 djm Exp $ */ +/* $OpenBSD: if_tun.c,v 1.80 2006/11/01 03:37:24 tedu Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -947,7 +947,7 @@ tunpoll(dev_t dev, int events, struct proc *p) struct mbuf *m; if ((tp = tun_lookup(minor(dev))) == NULL) - return (ENXIO); + return (POLLERR); ifp = &tp->tun_if; revents = 0; -- cgit v1.2.3