mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
tidy-up: gettimeofday()
fallback and use
Simplify the way we handle `gettimeofday()` fallback for platforms without native support or without any support. Make it similar to how we handle `snprintf()`. In case of no native `gettimeofday()` support and a non-Windows platform, our local fallback returns zero in `tv_usec` and `tv_sec`, ending up with a zero `timeout_remaining` in `session.c`, same as before this patch. Also: - drop unused `sys/time.h` headers. - fix our fallback code to compile with any Windows compilers (not just MSVC) - delete unnecessary casts. Closes #1001
This commit is contained in:
@ -24,9 +24,6 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
Reference in New Issue
Block a user