From: Roy Marples Date: Wed, 3 Feb 2021 20:52:01 +0000 (+0000) Subject: Fix tests X-Git-Tag: v10.0.0~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0025a1268a117ae6fc5809d926609a4dea3b61fd;p=thirdparty%2Fdhcpcd.git Fix tests --- diff --git a/tests/eloop-bench/eloop-bench.c b/tests/eloop-bench/eloop-bench.c index 0f90e824..c592575e 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 + * Copyright (c) 2006-2021 Roy Marples * 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"); }