From a60ffa9591a680bd1614985749e83ab043e40fe5 Mon Sep 17 00:00:00 2001 From: naxuroqa Date: Wed, 9 Oct 2013 10:49:27 +0200 Subject: [PATCH] fix for missing EAGAIN definition on windows --- toxcore/network.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toxcore/network.c b/toxcore/network.c index 51f064e7..38adc179 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -212,9 +212,12 @@ int sendpacket(Networking_Core *net, IP_Port ip_port, uint8_t *data, uint32_t le if (res == length) net->send_fail_eagain = 0; +#ifdef WIN32 + else if ((res < 0) && (errno == WSAEWOULDBLOCK)) +#else else if ((res < 0) && (errno == EAGAIN)) - net->send_fail_eagain = current_time(); - +#endif + net->send_fail_eagain = current_time(); return res; }