summaryrefslogtreecommitdiff
path: root/ev_port.c
diff options
context:
space:
mode:
authorroot <root>2007-12-14 18:04:31 +0000
committerroot <root>2007-12-14 18:04:31 +0000
commit3d981a26dbc74027d7d641112e92d299966e4fe7 (patch)
tree2b1bbfd40bbd5cee21261aff6fa8ba88e3b46ff3 /ev_port.c
parentdfa948951dd77048e8b05540d86c4ffe1a0205d2 (diff)
fix solaris backend
Diffstat (limited to 'ev_port.c')
-rw-r--r--ev_port.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/ev_port.c b/ev_port.c
index 169181d..e457485 100644
--- a/ev_port.c
+++ b/ev_port.c
@@ -36,22 +36,14 @@
#include <string.h>
#include <errno.h>
-static void
-port_modify (EV_P_ int fd, int oev, int nev)
+void inline_speed
+port_associate_and_check (EV_P_ int fd, int ev)
{
- /* we need to reassociate no matter what, as closes are
- * once more silently being discarded.
- */
- if (!nev)
- {
- if (oev)
- port_dissociate (backend_fd, PORT_SOURCE_FD, fd);
- }
- else if (0 >
+ if (0 >
port_associate (
backend_fd, PORT_SOURCE_FD, fd,
- (nev & EV_READ ? POLLIN : 0)
- | (nev & EV_WRITE ? POLLOUT : 0),
+ (ev & EV_READ ? POLLIN : 0)
+ | (ev & EV_WRITE ? POLLOUT : 0),
0
)
)
@@ -60,7 +52,22 @@ port_modify (EV_P_ int fd, int oev, int nev)
fd_kill (EV_A_ fd);
else
syserr ("(libev) port_associate");
- }
+ }
+}
+
+static void
+port_modify (EV_P_ int fd, int oev, int nev)
+{
+ /* we need to reassociate no matter what, as closes are
+ * once more silently being discarded.
+ */
+ if (!nev)
+ {
+ if (oev)
+ port_dissociate (backend_fd, PORT_SOURCE_FD, fd);
+ }
+ else
+ port_associate_and_check (EV_A_ fd, nev);
}
static void
@@ -95,8 +102,7 @@ port_poll (EV_P_ ev_tstamp timeout)
| (port_events [i].portev_events & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)
);
- anfds [fd].events = 0; /* event received == disassociated */
- fd_change (EV_A_ fd); /* need to reify later */
+ port_associate_and_check (EV_A_ fd, anfds [fd].events);
}
}