Fix for Debian compile error: api_sleep (taking address of temporary array)

This commit is contained in:
Joseph Henry
2017-12-07 11:09:38 -08:00
parent 339db07569
commit 76af1d4246
2 changed files with 5 additions and 1 deletions

View File

@@ -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