mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-25 03:29:00 +08:00
Fix #1533 - fix iotest error on windows
This commit is contained in:
parent
a7cbc19755
commit
bdd7d92108
@ -3593,7 +3593,11 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((rc = select((int) maxfd + 1, &rset, &wset, NULL, &tv)) < 0) {
|
if ((rc = select((int) maxfd + 1, &rset, &wset, NULL, &tv)) < 0) {
|
||||||
|
#if MG_ARCH == MG_ARCH_WIN32
|
||||||
|
if (maxfd == 0) Sleep(ms); // On Windows, select fails if no sockets
|
||||||
|
#else
|
||||||
MG_ERROR(("select: %d %d", rc, MG_SOCK_ERRNO));
|
MG_ERROR(("select: %d %d", rc, MG_SOCK_ERRNO));
|
||||||
|
#endif
|
||||||
FD_ZERO(&rset);
|
FD_ZERO(&rset);
|
||||||
FD_ZERO(&wset);
|
FD_ZERO(&wset);
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,11 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((rc = select((int) maxfd + 1, &rset, &wset, NULL, &tv)) < 0) {
|
if ((rc = select((int) maxfd + 1, &rset, &wset, NULL, &tv)) < 0) {
|
||||||
|
#if MG_ARCH == MG_ARCH_WIN32
|
||||||
|
if (maxfd == 0) Sleep(ms); // On Windows, select fails if no sockets
|
||||||
|
#else
|
||||||
MG_ERROR(("select: %d %d", rc, MG_SOCK_ERRNO));
|
MG_ERROR(("select: %d %d", rc, MG_SOCK_ERRNO));
|
||||||
|
#endif
|
||||||
FD_ZERO(&rset);
|
FD_ZERO(&rset);
|
||||||
FD_ZERO(&wset);
|
FD_ZERO(&wset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user