Fix for Debian compile error: api_sleep (taking address of temporary array)
This commit is contained in:
@@ -156,6 +156,7 @@ struct sockaddr_ll {
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
// Provide missing optnames for setsockopt() implementations
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN64
|
||||
@@ -193,6 +194,7 @@ struct sockaddr_ll {
|
||||
#else
|
||||
# error "Unknown platform"
|
||||
#endif
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/* Legend */
|
||||
|
||||
@@ -555,7 +555,9 @@ bool _ipv6_in_subnet(ZeroTier::InetAddress *subnet, ZeroTier::InetAddress *addr)
|
||||
|
||||
void api_sleep(int interval_ms)
|
||||
{
|
||||
nanosleep((const struct timespec[]) {{0, (interval_ms * 500000)}}, NULL);
|
||||
struct timespec sleepValue = {0};
|
||||
sleepValue.tv_nsec = interval_ms * 500000;
|
||||
nanosleep(&sleepValue, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user