diff options
author | jake <jake@FreeBSD.org> | 2003-08-24 00:35:10 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-08-24 00:35:10 +0000 |
commit | 72becf170cf2acc2dccb82135a4d304a5f4c4b14 (patch) | |
tree | c29adbbeb9a8d5d446e40886762582ee90985df3 | |
parent | 4270721f5e2507303e5e6140594f105ca8f3423a (diff) | |
download | FreeBSD-src-72becf170cf2acc2dccb82135a4d304a5f4c4b14.zip FreeBSD-src-72becf170cf2acc2dccb82135a4d304a5f4c4b14.tar.gz |
Fix endian bugs accessing ioctl arguments that are passed by value.
-rw-r--r-- | sys/dev/syscons/scvidctl.c | 4 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c index 8a7656b..86f9443 100644 --- a/sys/dev/syscons/scvidctl.c +++ b/sys/dev/syscons/scvidctl.c @@ -654,7 +654,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread * #endif /* SC_NO_MODE_CHANGE */ case KDSETMODE: /* set current mode of this (virtual) console */ - switch (*(int *)data) { + switch (*(intptr_t *)data) { case KD_TEXT: /* switch to TEXT (known) mode */ /* * If scp->mode is of graphics modes, we don't know which @@ -783,7 +783,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread * return 0; case KDSBORDER: /* set border color of this (virtual) console */ - scp->border = *data; + scp->border = *(intptr_t *)data; if (scp == scp->sc->cur_scp) sc_set_border(scp, scp->border); return 0; diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 6b42c94..faa70bd 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -961,7 +961,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) return EPERM; } error = EINVAL; - switch(*(int *)data) { + switch(*(intptr_t *)data) { case VT_FALSE: /* user refuses to release screen, abort */ if ((error = finish_vt_rel(scp, FALSE, &s)) == 0) DPRINTF(5, ("sc%d: VT_FALSE\n", sc->unit)); @@ -991,14 +991,14 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) return EINVAL; case VT_ACTIVATE: /* switch to screen *data */ - i = (*(int *)data == 0) ? scp->index : (*(int *)data - 1); + i = (*(intptr_t *)data == 0) ? scp->index : (*(intptr_t *)data - 1); s = spltty(); sc_clean_up(sc->cur_scp); splx(s); return sc_switch_scr(sc, i); case VT_WAITACTIVE: /* wait for switch to occur */ - i = (*(int *)data == 0) ? scp->index : (*(int *)data - 1); + i = (*(intptr_t *)data == 0) ? scp->index : (*(intptr_t *)data - 1); if ((i < sc->first_vty) || (i >= sc->first_vty + sc->vtys)) return EINVAL; s = spltty(); |