From: deraadt Date: Fri, 21 Apr 2000 07:39:15 +0000 (+0000) Subject: do not declare and use a local variable which conflicts with a global X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=95367cb1b05792f21e88a054d05667c2c55c48f7;p=openbsd do not declare and use a local variable which conflicts with a global variable which is used by a macro when VM is used instead of UVM. very cute, Art -- 10 points for artistic expression. --- diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 240d13c8fb1..62bd73a871f 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.18 2000/04/20 10:03:42 art Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.19 2000/04/21 07:39:15 deraadt Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -194,7 +194,7 @@ ktrgenio(vp, fd, rw, iov, len, error) struct ktr_header kth; struct ktr_genio *ktp; caddr_t cp; - int resid = len, cnt; + int resid = len, count; struct proc *p = curproc; /* XXX */ int buflen; @@ -223,24 +223,24 @@ ktrgenio(vp, fd, rw, iov, len, error) if (p->p_schedflags & PSCHED_SHOULDYIELD) preempt(NULL); - cnt = min(iov->iov_len, buflen); - if (cnt > resid) - cnt = resid; - if (copyin(iov->iov_base, cp, cnt)) + count = min(iov->iov_len, buflen); + if (count > resid) + count = resid; + if (copyin(iov->iov_base, cp, count)) break; - kth.ktr_len = cnt + sizeof(struct ktr_genio); + kth.ktr_len = count + sizeof(struct ktr_genio); if (ktrwrite(vp, &kth) != 0) break; - iov->iov_len -= cnt; - iov->iov_base += cnt; + iov->iov_len -= count; + iov->iov_base += count; if (iov->iov_len == 0) iov++; - resid -= cnt; + resid -= count; } FREE(ktp, M_TEMP);