[PATCH] type issue in kern_event.c

MQ antinvidia at gmail.com
Sat Aug 1 06:59:32 UTC 2009


2009/8/1 Ed Schouten <ed at 80386.nl>:
> 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/
>

The sizof in the first argument of bzero should also be replaced.


More information about the freebsd-arch mailing list