summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2000-04-21 07:39:15 +0000
committerderaadt <deraadt@openbsd.org>2000-04-21 07:39:15 +0000
commit95367cb1b05792f21e88a054d05667c2c55c48f7 (patch)
tree5087b8af0e2b8ccc7e25ec2001f086946dc8c1fc
parentAdapted from NetBSD: mention the 'al'/'AL' console mode bug and its workaround (diff)
downloadwireguard-openbsd-95367cb1b05792f21e88a054d05667c2c55c48f7.tar.xz
wireguard-openbsd-95367cb1b05792f21e88a054d05667c2c55c48f7.zip
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.
-rw-r--r--sys/kern/kern_ktrace.c20
1 files changed, 10 insertions, 10 deletions
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);