summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliuyacan <liuyacan@corp.netease.com>2021-08-02 10:01:39 +0800
committerliuyacan <liuyacan@corp.netease.com>2021-08-02 10:06:10 +0800
commitf71796e5279e086c669699e2fd8ee110d7086afa (patch)
treea16dab9baec7ac04e91a433605fb693d24a70e30
parentfdcbd38dc14d13e9aa463f28423cc0cc33c2768b (diff)
vcl: fix sleep time in ldp_pselect()
Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: Ic9c5b23be4bde88880972be35525f12fa2c6dc10
-rw-r--r--src/vcl/ldp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index de886ca95b9..4b21c7d3c7a 100644
--- a/src/vcl/ldp.c
+++ b/src/vcl/ldp.c
@@ -724,10 +724,11 @@ ldp_pselect (int nfds, fd_set * __restrict readfds,
time_out = (timeout->tv_sec == 0 && timeout->tv_nsec == 0) ?
(f64) 0 : (f64) timeout->tv_sec + (f64) timeout->tv_nsec / (f64) 1e9;
+ time_out += clib_time_now (&ldpw->clib_time);
+
/* select as fine grained sleep */
if (!nfds)
{
- time_out += clib_time_now (&ldpw->clib_time);
while (clib_time_now (&ldpw->clib_time) < time_out)
;
return 0;