diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-13 15:35:18 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-13 15:35:18 +0000 |
commit | b33474b818d0af67b6b7ddf4ec8278184215f15b (patch) | |
tree | 6752a2c1723ea9d1ca9713f147b580985cbd0531 /sys/dev | |
parent | 12b239a9af67309e2846c49500562b9ec2a5551f (diff) |
Make this compile under OpenBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/wscons/wsmux.c | 19 | ||||
-rw-r--r-- | sys/dev/wscons/wsmuxvar.h | 6 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index 996bc3c9083..c771a393242 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.2 2000/08/01 13:51:18 mickey Exp $ */ +/* $OpenBSD: wsmux.c,v 1.3 2000/11/13 15:35:17 aaron Exp $ */ /* $NetBSD: wsmux.c,v 1.9 2000/05/28 10:33:14 takemura Exp $ */ /* @@ -103,7 +103,7 @@ struct wsmuxops wsmux_muxops = { void wsmux_setmax __P((int n)); int nwsmux = 0; -struct wsmux_softc **wsmuxdevs; +struct wsmux_softc **wsmuxdevs = NULL; void wsmux_setmax(n) @@ -114,13 +114,12 @@ wsmux_setmax(n) if (n >= nwsmux) { i = nwsmux; nwsmux = n + 1; - if (nwsmux != 0) - wsmuxdevs = realloc(wsmuxdevs, - nwsmux * sizeof (*wsmuxdevs), - M_DEVBUF, M_NOWAIT); - else - wsmuxdevs = malloc(nwsmux * sizeof (*wsmuxdevs), - M_DEVBUF, M_NOWAIT); + if (nwsmux != 0) { + if (wsmuxdevs) + free(wsmuxdevs, M_DEVBUF); + } + wsmuxdevs = malloc(nwsmux * sizeof (*wsmuxdevs), + M_DEVBUF, M_NOWAIT); if (wsmuxdevs == 0) panic("wsmux_setmax: no memory\n"); for (; i < nwsmux; i++) @@ -286,7 +285,7 @@ wsmuxioctl(dev, cmd, data, flag, p) } int -wsmuxpoll(dev, events, p) +wsmuxselect(dev, events, p) dev_t dev; int events; struct proc *p; diff --git a/sys/dev/wscons/wsmuxvar.h b/sys/dev/wscons/wsmuxvar.h index 37c57cdb2f9..04ac0dcac89 100644 --- a/sys/dev/wscons/wsmuxvar.h +++ b/sys/dev/wscons/wsmuxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmuxvar.h,v 1.2 2000/08/01 13:51:19 mickey Exp $ */ +/* $OpenBSD: wsmuxvar.h,v 1.3 2000/11/13 15:35:17 aaron Exp $ */ /* $NetBSD: wsmuxvar.h,v 1.1 1999/07/29 18:20:43 augustss Exp $ */ /* @@ -67,7 +67,9 @@ struct wsmuxops { /* * configure defines */ -#define WSKBDDEVCF_MUX_DEFAULT -1 +#define WSKBDDEVCF_MUX_DEFAULT -1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT -1 struct wsmux_softc *wsmux_create __P((const char *name, int no)); int wsmux_attach_sc __P(( |