From d717d627c23ed9850c197ca048a9773fd39d554a Mon Sep 17 00:00:00 2001 From: likewise Date: Tue, 17 Jun 2003 14:04:54 +0000 Subject: [PATCH] Fixes bug reported on lwip-users by Florian Zschocke on 13-06-2003 16:07. The lwip_select() could truncate the timeout to become 0 (wait forever). --- src/api/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index e93c5bc5..0fbed317 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -723,7 +723,7 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, /* Wait forever */ msectimeout = 0; else - msectimeout = ((timeout->tv_sec * 1000) + (timeout->tv_usec /1000)); + msectimeout = ((timeout->tv_sec * 1000) + ((timeout->tv_usec + 500)/1000)); i = sys_sem_wait_timeout(select_cb.sem, msectimeout);