[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [Libevent-users] epoll erros



> -----Original Message-----
> From: owner-libevent-users@xxxxxxxxxxxxx [mailto:owner-libevent-
> users@xxxxxxxxxxxxx] On Behalf Of Nick Mathewson
> Sent: Friday, October 22, 2010 10:39 AM
> To: libevent-users@xxxxxxxxxxxxx
> Subject: Re: [Libevent-users] epoll erros
> 
...
> It won't catch attempts to manually reassign the event's ev_events
> while the event is added.  I sure hope nobody is doing that.  Don't
> touch struct event's fields by hand.

Following this comment I discovered that my code does touch ev_events by
hand. Fixing my code with the patch below did not make the problem go away

-       if (requested && ev->ev_events != requested) {
-               printf("changing event %p:%p from %d to
%d(%s)",easy,ev,ev->ev_events,requested,vevent_libevnet_ev2string(requested)
);
+       if (requested && event_get_events(ev) != requested) {
+               printf("changing event %p:%p from %d to
%d(%s)",easy,ev,event_get_events(ev),requested,vevent_libevnet_ev2string(req
uested));
                event_del(ev);
-               ev->ev_events = requested;
+               event_set(ev, event_get_fd(ev), requested,
event_get_callback(ev), event_get_callback_arg(ev));
                if ( event_add(ev,NULL) !=0 ) {
HTH




***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.