aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/freebsd32/freebsd32_misc.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2015-05-05 05:14:12 +0000
committerPeter Wemm <peter@FreeBSD.org>2015-05-05 05:14:12 +0000
commit76cd25496f4dd03c0cec02e744c889f7e0de164c (patch)
treed95827bd975d6ee5e5987e60cda55142932c652b /sys/compat/freebsd32/freebsd32_misc.c
parent531258ace4a7cd01d30e577359e4000280b62b70 (diff)
downloadsrc-76cd25496f4dd03c0cec02e744c889f7e0de164c.tar.gz
src-76cd25496f4dd03c0cec02e744c889f7e0de164c.zip
Fix an error in r281551, part of the getfsstat() / kern_getfsstat()
rework. The number of entries was supposed to be returned to the user, not used as a scratch variable. This broke RELENG_4 jails starting up on current systems.
Notes
Notes: svn path=/head/; revision=282448
Diffstat (limited to 'sys/compat/freebsd32/freebsd32_misc.c')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 8696b3664b3d..67210ff59de4 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -248,7 +248,7 @@ freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfss
{
struct statfs *buf, *sp;
struct statfs32 stat32;
- size_t count, size;
+ size_t count, size, copycount;
int error;
count = uap->bufsize / sizeof(struct statfs32);
@@ -256,12 +256,13 @@ freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfss
error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags);
if (size > 0) {
sp = buf;
- while (count > 0 && error == 0) {
+ copycount = count;
+ while (copycount > 0 && error == 0) {
copy_statfs(sp, &stat32);
error = copyout(&stat32, uap->buf, sizeof(stat32));
sp++;
uap->buf++;
- count--;
+ copycount--;
}
free(buf, M_TEMP);
}