diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-04-11 17:46:14 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-04-11 17:46:14 +0000 |
commit | 61aa9f455f35787ac8e5a3b273f508ce56fb6ffd (patch) | |
tree | dcef41e4367758d35f62baf39e8c863cccdaf8d5 | |
parent | f91318e7cad5dd493a365b8a4c2968af86cc0323 (diff) |
In sys_ioctl(), change the type of stkbuf to u_long to make sure it is
properly aligned. Otherwise we lose on strict alignment architectures if
the compiler happens to give it a smaller alignment. Fixes another gcc4
problem on sparc64.
ok miod@
-rw-r--r-- | sys/kern/sys_generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 70e3ac8c8cc..279e514eb26 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.67 2009/11/09 17:53:39 nicm Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.68 2010/04/11 17:46:13 kettenis Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -396,7 +396,7 @@ sys_ioctl(struct proc *p, void *v, register_t *retval) caddr_t data, memp; int tmp; #define STK_PARAMS 128 - char stkbuf[STK_PARAMS]; + u_long stkbuf[STK_PARAMS / sizeof(u_long)]; fdp = p->p_fd; if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL) @@ -427,7 +427,7 @@ sys_ioctl(struct proc *p, void *v, register_t *retval) memp = (caddr_t)malloc((u_long)size, M_IOCTLOPS, M_WAITOK); data = memp; } else - data = stkbuf; + data = (caddr_t)stkbuf; if (com&IOC_IN) { if (size) { error = copyin(SCARG(uap, data), data, (u_int)size); |