mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 20:07:56 -04:00
do not insert event into list when evsel->add fails
svn:r660
This commit is contained in:
parent
5a2ece1895
commit
bb914ed9af
@ -46,6 +46,7 @@ Changes in current version:
|
||||
o detect integer types properly on platforms without stdint.h
|
||||
o udpate documentation of event_loop and event_base_loop; from Tani Hosokawa.
|
||||
o simplify evbuffer by removing orig_buffer
|
||||
o do not insert event into list when evsel->add fails
|
||||
|
||||
|
||||
Changes in 1.4.0:
|
||||
|
12
event.c
12
event.c
@ -735,14 +735,18 @@ event_add(struct event *ev, struct timeval *tv)
|
||||
|
||||
if ((ev->ev_events & (EV_READ|EV_WRITE)) &&
|
||||
!(ev->ev_flags & (EVLIST_INSERTED|EVLIST_ACTIVE))) {
|
||||
event_queue_insert(base, ev, EVLIST_INSERTED);
|
||||
int res = evsel->add(evbase, ev);
|
||||
if (res != -1)
|
||||
event_queue_insert(base, ev, EVLIST_INSERTED);
|
||||
|
||||
return (evsel->add(evbase, ev));
|
||||
return (res);
|
||||
} else if ((ev->ev_events & EV_SIGNAL) &&
|
||||
!(ev->ev_flags & EVLIST_SIGNAL)) {
|
||||
event_queue_insert(base, ev, EVLIST_SIGNAL);
|
||||
int res = evsel->add(evbase, ev);
|
||||
if (res != -1)
|
||||
event_queue_insert(base, ev, EVLIST_SIGNAL);
|
||||
|
||||
return (evsel->add(evbase, ev));
|
||||
return (res);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user