[PATCH] type issue in kern_event.c
Ed Schouten
ed at 80386.nl
Fri Jul 31 22:17:20 UTC 2009
Hi Dag-Erling,
* Dag-Erling Smørgrav <des at des.no> wrote:
> Xin LI <delphij at delphij.net> writes:
> > I think these should be fixed, and here is my proposed patch.
>
> 404 Patch Not Found
Xin Li sent it to me, but I think he has forgotten to add the lists back
to Cc again. Here's the patch he sent to me earlier today.
Index: kern_event.c
===================================================================
--- kern_event.c (revision 195945)
+++ kern_event.c (working copy)
@@ -1106,7 +1106,7 @@ kqueue_expand(struct kqueue *kq, struct filterops
size = kq->kq_knlistsize;
while (size <= fd)
size += KQEXTENT;
- list = malloc(size * sizeof list, M_KQUEUE, mflag);
+ list = malloc(size * sizeof *list, M_KQUEUE, mflag);
if (list == NULL)
return ENOMEM;
KQ_LOCK(kq);
@@ -1116,13 +1116,13 @@ kqueue_expand(struct kqueue *kq, struct filterops
} else {
if (kq->kq_knlist != NULL) {
bcopy(kq->kq_knlist, list,
- kq->kq_knlistsize * sizeof list);
+ kq->kq_knlistsize * sizeof *list);
free(kq->kq_knlist, M_KQUEUE);
kq->kq_knlist = NULL;
}
bzero((caddr_t)list +
kq->kq_knlistsize * sizeof list,
- (size - kq->kq_knlistsize) * sizeof list);
+ (size - kq->kq_knlistsize) * sizeof *list);
kq->kq_knlistsize = size;
kq->kq_knlist = list;
}
--
Ed Schouten <ed at 80386.nl>
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20090731/d1847d87/attachment.pgp
More information about the freebsd-arch
mailing list