On some systems (notably HPUX), there is already a
/usr/include/sys/_time.h, which our sys/_time.h shadows. Found and
diagnosed by Kathryn Hogg.
This is a quick fix for 1.4 only; for 2.0, I want to eliminate
compat/sys/_time.h entirely, and have util-internal subsume it.
svn:r1493
New backends like poll and kqueue and so on add fds to the queue in
the order that they are triggered. But the select backend currently
activates low-numbered fds first, whereas the poll and win32 backends
currently favor whatever fds have been on for the longest. This is no
good for fairness.
svn:r1327
Generally speaking, it way better to event_assign() an event when you
allocate it than to assign it before every time you event_add it: if
it is already event_add()ed, the assign will mess it up so that it
doesn't _look_ added, and event_add() will insert a second copy.
Later, event_del() will only delete the second copy. Eventually, the
event_base will have a dangling pointer to freed memory. Ouch!
svn:r1308
Some win32 systems (mostly those using Kaspersky, it would seem)
prevent us from faking socketpair(). This makes our signal
notification code just not work. Our response since 1.4 has been to
assert. For users who would rather work without signals than not work
at all, this has been a regression from 1.3e.
This patch makes adding signal events fail in this case; there's no
reason to kill the whole process.
svn:r1304
This is based on patch 2790759 from Kevin Springborn. His comments on
sourceforge:
Problem:
The failure case is as follows: Event is added using epoll_add (a
direct pointer is stored in the user_data section), epoll_recalc is
called and the fds array is moved (invalidating the user_data
pointer stored in epoll). epoll_dispatch is called for the added
event and accesses evepoll based on the invalid pointer (set before
the fds array was relocated).
Solution:
Dispatch has access to the epollop structure, so given the fd we can
find the corresponding evepoll struct. Use data.fd instead of
data.ptr and store the fd corresponding to the event. This way when
epoll_recalc moves the fds array (and updates the fds array pointer
in epollop), the evepoll calculation in dispatch still finds the
valid evepoll struct.
svn:r1282
Previously, we could lose the heap property when we removed an item
whose parent was greater than the last element in the heap. We would
replace the removed item with the last element, and consider shifting
it down, but we wouldn't consider shifting it up.
Patch from Marko Kreen.
svn:r1227