summaryrefslogtreecommitdiffstats
path: root/src/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev.c')
-rw-r--r--src/dev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dev.c b/src/dev.c
index d33c8faa..88dfc0de 100644
--- a/src/dev.c
+++ b/src/dev.c
@@ -167,10 +167,13 @@ dev_start1(struct dhcpcd_ctx *ctx, const struct dev_dhcpcd *dev_dhcpcd)
}
static void
-dev_handle_data(void *arg)
+dev_handle_data(void *arg, unsigned short events)
{
struct dhcpcd_ctx *ctx;
+ if (events != ELE_READ)
+ logerrx("%s: unexpected event 0x%04x", __func__, events);
+
ctx = arg;
if (ctx->dev->handle_device(arg) == -1) {
/* XXX: an error occured. should we restart dev? */
@@ -191,7 +194,7 @@ dev_start(struct dhcpcd_ctx *ctx, int (*handler)(void *, int, const char *))
ctx->dev_fd = dev_start1(ctx, &dev_dhcpcd);
if (ctx->dev_fd != -1) {
- if (eloop_event_add(ctx->eloop, ctx->dev_fd,
+ if (eloop_event_add(ctx->eloop, ctx->dev_fd, ELE_READ,
dev_handle_data, ctx) == -1)
{
logerr(__func__);