From 357b788e667bdd51b66bbc0cc88cf82ae3169455 Mon Sep 17 00:00:00 2001 From: Noah Meyerhans Date: Wed, 16 Feb 2022 22:25:30 -0800 Subject: [PATCH 1/2] arping: fix typo in error checking When attempting to check the return value of timerfd_create(), we were not checking the value of the variable containing the return value. Fixes: e594ca5 ("arping: use additional timerfd to control when timeout happens") Reviewed-by: Petr Vorel Signed-off-by: Noah Meyerhans (cherry picked from commit 8a6a2ce3cd0cdf69f0551a3a1e598a191561d18e) --- arping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arping.c b/arping.c index ee9da1d..8059517 100644 --- a/arping.c +++ b/arping.c @@ -733,7 +733,7 @@ static int event_loop(struct run_state *ctl) /* timeout timerfd */ timeoutfd = timerfd_create(CLOCK_MONOTONIC, 0); - if (tfd == -1) { + if (timeoutfd == -1) { error(0, errno, "timerfd_create failed"); return 1; } -- 2.46.0