mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
Fix #1533 - fix iotest error on windows
This commit is contained in:
1 parent
a7cbc19755
commit
bdd7d92108
2 files changed
+8
No files matched your search
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user