summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_misc.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2005-05-29 22:08:16 +0000
committerchristos <christos@NetBSD.org>2005-05-29 22:08:16 +0000
commitfb4b40b7e88f729bb1ceefb180c21d3ac2be1daf (patch)
tree5c76a5462f20c8a6e937d338b4fa61db995de85b /sys/compat/linux/common/linux_misc.c
parent1473b3a0a174d07386ce91cb2a8df7d3ce64d38c (diff)
- sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs an api change. - avoid variable shadowing.
Diffstat (limited to 'sys/compat/linux/common/linux_misc.c')
-rw-r--r--sys/compat/linux/common/linux_misc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 178106160ec..ff66e6c6233 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.137 2005/05/03 16:26:28 manu Exp $ */
+/* $NetBSD: linux_misc.c,v 1.138 2005/05/29 22:08:16 christos Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.137 2005/05/03 16:26:28 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.138 2005/05/29 22:08:16 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -776,7 +776,7 @@ linux_sys_getdents(l, v, retval)
struct proc *p = l->l_proc;
struct dirent *bdp;
struct vnode *vp;
- caddr_t inp, buf; /* BSD-format */
+ caddr_t inp, tbuf; /* BSD-format */
int len, reclen; /* BSD-format */
caddr_t outp; /* Linux-format */
int resid, linux_reclen = 0; /* Linux-format */
@@ -819,12 +819,12 @@ linux_sys_getdents(l, v, retval)
buflen = va.va_blocksize;
oldcall = 0;
}
- buf = malloc(buflen, M_TEMP, M_WAITOK);
+ tbuf = malloc(buflen, M_TEMP, M_WAITOK);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
off = fp->f_offset;
again:
- aiov.iov_base = buf;
+ aiov.iov_base = tbuf;
aiov.iov_len = buflen;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
@@ -842,7 +842,7 @@ again:
if (error)
goto out;
- inp = buf;
+ inp = tbuf;
outp = (caddr_t)SCARG(uap, dent);
resid = nbytes;
if ((len = buflen - auio.uio_resid) == 0)
@@ -918,7 +918,7 @@ out:
VOP_UNLOCK(vp, 0);
if (cookiebuf)
free(cookiebuf, M_TEMP);
- free(buf, M_TEMP);
+ free(tbuf, M_TEMP);
out1:
FILE_UNUSE(fp, p);
return error;
@@ -1518,7 +1518,7 @@ linux_sys_swapoff(l, v, retval)
} */ *uap = v;
SCARG(&ua, cmd) = SWAP_OFF;
- SCARG(&ua, arg) = (void *)SCARG(uap, path);
+ SCARG(&ua, arg) = __UNCONST(SCARG(uap, path)); /*XXXUNCONST*/
return (sys_swapctl(l, &ua, retval));
}
@@ -1668,7 +1668,7 @@ linux_sys_setrlimit(l, v, retval)
} */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- struct sys_setrlimit_args ap;
+ struct sys_getrlimit_args ap;
struct rlimit rl;
struct orlimit orl;
int error;
@@ -1680,8 +1680,7 @@ linux_sys_setrlimit(l, v, retval)
if ((error = copyin(SCARG(uap, rlp), &orl, sizeof(orl))) != 0)
return error;
linux_to_bsd_rlimit(&rl, &orl);
- /* XXX: alpha complains about this */
- if ((error = copyout(&rl, (void *)SCARG(&ap, rlp), sizeof(rl))) != 0)
+ if ((error = copyout(&rl, SCARG(&ap, rlp), sizeof(rl))) != 0)
return error;
return sys_setrlimit(l, &ap, retval);
}