diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-01-28 02:16:20 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-01-28 02:16:20 +0000 |
| commit | 159823e200e763529b0885715c0624559aacf82a (patch) | |
| tree | 12900527bc7ff7b3f5ea09123f5141311fce7fb6 /src | |
| parent | a466bd5d4266047e3a54387a76ad5665055e583a (diff) | |
| download | luasocket-159823e200e763529b0885715c0624559aacf82a.tar.gz luasocket-159823e200e763529b0885715c0624559aacf82a.tar.bz2 luasocket-159823e200e763529b0885715c0624559aacf82a.zip | |
Added support for the CYGWIN gcc compiler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luasocket.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/luasocket.c b/src/luasocket.c index b81bca7..644edd6 100644 --- a/src/luasocket.c +++ b/src/luasocket.c | |||
| @@ -1205,7 +1205,7 @@ static void tm_markstart(p_sock sock) | |||
| 1205 | \*-------------------------------------------------------------------------*/ | 1205 | \*-------------------------------------------------------------------------*/ |
| 1206 | static int tm_gettime(void) | 1206 | static int tm_gettime(void) |
| 1207 | { | 1207 | { |
| 1208 | #ifdef _WIN32 | 1208 | #ifdef WIN32 |
| 1209 | return GetTickCount(); | 1209 | return GetTickCount(); |
| 1210 | #else | 1210 | #else |
| 1211 | struct tms t; | 1211 | struct tms t; |
| @@ -1290,13 +1290,19 @@ static int send_raw(p_sock sock, const char *data, int wanted, int *total) | |||
| 1290 | /* a bug in WinSock forces us to do a busy wait until we manage | 1290 | /* a bug in WinSock forces us to do a busy wait until we manage |
| 1291 | ** to write, because select returns immediately even though it | 1291 | ** to write, because select returns immediately even though it |
| 1292 | ** should have blocked us until we could write... */ | 1292 | ** should have blocked us until we could write... */ |
| 1293 | if (WSAGetLastError() == WSAEWOULDBLOCK) | 1293 | if (put < 0 && WSAGetLastError() == WSAEWOULDBLOCK) |
| 1294 | continue; | 1294 | continue; |
| 1295 | #endif | 1295 | #endif |
| 1296 | #ifdef __CYGWIN__ | ||
| 1297 | /* this is for CYGWIN, which is like Unix but with Win32 Bugs */ | ||
| 1298 | if (put < 0 && errno == EWOULDBLOCK) | ||
| 1299 | continue; | ||
| 1300 | #endif | ||
| 1301 | |||
| 1296 | return NET_CLOSED; | 1302 | return NET_CLOSED; |
| 1297 | } | 1303 | } |
| 1298 | wanted -= put; | 1304 | wanted -= put; |
| 1299 | data += put; | 1305 | data += put; |
| 1300 | *total += put; | 1306 | *total += put; |
| 1301 | } | 1307 | } |
| 1302 | return NET_DONE; | 1308 | return NET_DONE; |
