timeval: scope a variable, merge two PP branches

Closes #20021
This commit is contained in:
Viktor Szakats 2025-12-18 23:14:27 +01:00
parent 1e0865b630
commit 2c31dc45b4
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -89,9 +89,6 @@ void curlx_pnow(struct curltime *pnow)
** in any case the time starting point does not change once that the
** system has started up.
*/
#ifdef HAVE_GETTIMEOFDAY
struct timeval now;
#endif
struct timespec tsnow;
/*
@ -135,6 +132,7 @@ void curlx_pnow(struct curltime *pnow)
*/
#ifdef HAVE_GETTIMEOFDAY
else {
struct timeval now;
(void)gettimeofday(&now, NULL);
pnow->tv_sec = now.tv_sec;
pnow->tv_usec = (int)now.tv_usec;