aboutsummaryrefslogtreecommitdiff
path: root/tests/eloop-bench/eloop-bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/eloop-bench/eloop-bench.c')
-rw-r--r--tests/eloop-bench/eloop-bench.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/eloop-bench/eloop-bench.c b/tests/eloop-bench/eloop-bench.c
index 0f90e824c3ad..fd0fb2edd3db 100644
--- a/tests/eloop-bench/eloop-bench.c
+++ b/tests/eloop-bench/eloop-bench.c
@@ -1,6 +1,6 @@
/*
* eloop benchmark
- * Copyright (c) 2006-2018 Roy Marples <roy@marples.name>
+ * Copyright (c) 2006-2023 Roy Marples <roy@marples.name>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
@@ -58,11 +58,14 @@ static struct pipe *pipes;
static struct eloop *e;
static void
-read_cb(void *arg)
+read_cb(void *arg, unsigned short events)
{
struct pipe *p = arg;
unsigned char buf[1];
+ if (events != ELE_READ)
+ warn("%s: unexpected events 0x%04x", __func__, events);
+
if (read(p->fd[0], buf, 1) != 1) {
warn("%s: read", __func__);
bad++;
@@ -156,7 +159,7 @@ main(int argc, char **argv)
for (i = 0, p = pipes; i < npipes; i++, p++) {
if (pipe2(p->fd, O_CLOEXEC | O_NONBLOCK) == -1)
err(EXIT_FAILURE, "pipe");
- if (eloop_event_add(e, p->fd[0], read_cb, p) == -1)
+ if (eloop_event_add(e, p->fd[0], ELE_READ, read_cb, p) == -1)
err(EXIT_FAILURE, "eloop_event_add");
}