djgpp: Skip check for negative timeval

This causes a warning since tv_sec is unsigned.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19322)
This commit is contained in:
J.W. Jagersma 2022-10-01 19:03:11 +02:00 committed by Hugo Landau
parent 523e54c15c
commit d8bcd64170
1 changed files with 2 additions and 0 deletions

View File

@ -97,8 +97,10 @@ OSSL_TIME ossl_time_from_timeval(struct timeval tv)
{
OSSL_TIME t;
#ifndef __DJGPP__ /* tv_sec is unsigned on djgpp. */
if (tv.tv_sec < 0)
return ossl_time_zero();
#endif
t.t = tv.tv_sec * OSSL_TIME_SECOND + tv.tv_usec * OSSL_TIME_US;
return t;
}