aboutsummaryrefslogtreecommitdiff
path: root/tests/eloop-bench/eloop-bench.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-06-03 16:17:02 +0000
committerEd Maste <emaste@FreeBSD.org>2024-06-03 16:19:54 +0000
commit1b2aa3deeb0dbbace9fed635fa01b6f6e8480901 (patch)
treed4f991a92b1c7c84e264b900f50f2fa0202c872a /tests/eloop-bench/eloop-bench.c
parent96dba636abec6d5451820add99300bda2ca6d86a (diff)
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");
}