serial_unix: Simplify timeout setting.

This commit is contained in:
Uwe Bonnes 2020-05-03 17:12:01 +02:00
parent 8fea3f6baa
commit 09602a9e74
1 changed files with 1 additions and 3 deletions

View File

@ -155,15 +155,13 @@ int platform_buffer_read(uint8_t *data, int maxsize)
uint8_t *c;
int s;
int ret;
uint32_t endTime;
fd_set rset;
struct timeval tv;
c = data;
tv.tv_sec = 0;
endTime = platform_time_ms() + RESP_TIMEOUT;
tv.tv_usec = 1000 * (endTime - platform_time_ms());
tv.tv_usec = 1000 * RESP_TIMEOUT;
/* Look for start of response */
do {