From: claudio Date: Thu, 25 Nov 2021 12:55:34 +0000 (+0000) Subject: Check for possible negative diff timeout. Clamp it to 0 in that case. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ed3d011490736316a8ee7b905d1b925e862fe4ed;p=openbsd Check for possible negative diff timeout. Clamp it to 0 in that case. poll with negative timeout noticed by job@ OK job@ --- diff --git a/usr.sbin/rpki-client/repo.c b/usr.sbin/rpki-client/repo.c index 5d8ecdefd64..5c6aa5f17dd 100644 --- a/usr.sbin/rpki-client/repo.c +++ b/usr.sbin/rpki-client/repo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repo.c,v 1.12 2021/11/15 16:32:15 claudio Exp $ */ +/* $OpenBSD: repo.c,v 1.13 2021/11/25 12:55:34 claudio Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -1213,6 +1213,8 @@ repo_next_timeout(int timeout) SLIST_FOREACH(rp, &repos, entry) { if (repo_state(rp) == REPO_LOADING) { int diff = rp->alarm - now; + if (diff < 0) + diff = 0; diff *= 1000; if (timeout == INFTIM || diff < timeout) timeout = diff;