diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-15 15:34:04 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-15 17:04:51 +0300 |
commit | 42d39ec4bfdc2fc5ba18f06a254d9c830539cf41 (patch) | |
tree | d7d7dfe97b771ce7d8fb507c799dfc6e2c86506c | |
parent | 8c4f7ce1ea84a2d2bf5aca6b09d98af4ecb71f61 (diff) | |
download | libmicrohttpd-42d39ec4bfdc2fc5ba18f06a254d9c830539cf41.tar.gz libmicrohttpd-42d39ec4bfdc2fc5ba18f06a254d9c830539cf41.zip |
test_upgrade: minor code refactoring
-rw-r--r-- | src/microhttpd/test_upgrade.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c index d2e0e536..64b0fc49 100644 --- a/src/microhttpd/test_upgrade.c +++ b/src/microhttpd/test_upgrade.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2016 Christian Grothoff | 3 | Copyright (C) 2016-2020 Christian Grothoff |
4 | Copyright (C) 2016-2022 Evgeny Grin (Karlson2k) | ||
4 | 5 | ||
5 | libmicrohttpd is free software; you can redistribute it and/or modify | 6 | libmicrohttpd is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 7 | it under the terms of the GNU General Public License as published |
@@ -1188,10 +1189,18 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon) | |||
1188 | NULL, | 1189 | NULL, |
1189 | NULL, | 1190 | NULL, |
1190 | &tv); | 1191 | &tv); |
1191 | if ( (-1 == ret) && | 1192 | if (0 > ret) |
1192 | (EAGAIN != errno) && | 1193 | { |
1193 | (EINTR != errno) ) | 1194 | #ifdef MHD_POSIX_SOCKETS |
1194 | mhdErrorExitDesc ("MHD_get_fdset() failed"); /* TODO: handle errors */ | 1195 | if (EINTR != errno) |
1196 | externalErrorExitDesc ("Unexpected select() error"); | ||
1197 | #else | ||
1198 | if ((WSAEINVAL != WSAGetLastError ()) || | ||
1199 | (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) | ||
1200 | externalErrorExitDesc ("Unexpected select() error"); | ||
1201 | Sleep (tv.tv_sec * 1000 + tv.tv_usec / 1000); | ||
1202 | #endif | ||
1203 | } | ||
1195 | MHD_run (daemon); | 1204 | MHD_run (daemon); |
1196 | } | 1205 | } |
1197 | } | 1206 | } |