Check return value of eventfd for errors.
This commit is contained in:
parent
f4ca542b92
commit
1ff3d00020
|
@ -35,7 +35,9 @@ final class PosixEventDriverEvents(Loop : PosixEventLoop, Sockets : EventDriverS
|
||||||
final override EventID create()
|
final override EventID create()
|
||||||
{
|
{
|
||||||
version (linux) {
|
version (linux) {
|
||||||
auto id = cast(EventID)eventfd(0, EFD_NONBLOCK);
|
auto eid = eventfd(0, EFD_NONBLOCK);
|
||||||
|
if (eid == -1) return EventID.invalid;
|
||||||
|
auto id = cast(EventID)eid;
|
||||||
m_loop.initFD(id);
|
m_loop.initFD(id);
|
||||||
m_loop.m_fds[id].specific = EventSlot(new ConsumableQueue!EventCallback); // FIXME: avoid dynamic memory allocation
|
m_loop.m_fds[id].specific = EventSlot(new ConsumableQueue!EventCallback); // FIXME: avoid dynamic memory allocation
|
||||||
m_loop.registerFD(id, EventMask.read);
|
m_loop.registerFD(id, EventMask.read);
|
||||||
|
|
Loading…
Reference in a new issue