poll: Fixed the ssh_poll_(init/cleanup) functions.
Этот коммит содержится в:
родитель
d991606493
Коммит
11a5383604
@ -262,6 +262,8 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ssh_poll_init(void) {
|
void ssh_poll_init(void) {
|
||||||
|
ssh_poll_emu = bsd_poll;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
hlib = LoadLibrary(WS2_LIBRARY);
|
hlib = LoadLibrary(WS2_LIBRARY);
|
||||||
if (hlib != NULL) {
|
if (hlib != NULL) {
|
||||||
@ -269,20 +271,20 @@ void ssh_poll_init(void) {
|
|||||||
}
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
if (wsa_poll == NULL) {
|
if (wsa_poll != NULL) {
|
||||||
ssh_poll_emu = bsd_poll;
|
ssh_poll_emu = bsd_poll;
|
||||||
} else {
|
|
||||||
ssh_poll_emu = win_poll;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ssh_poll_cleanup(void) {
|
void ssh_poll_cleanup(void) {
|
||||||
ssh_poll_emu = bsd_poll;
|
ssh_poll_emu = bsd_poll;
|
||||||
|
#ifdef _WIN32
|
||||||
wsa_poll = NULL;
|
wsa_poll = NULL;
|
||||||
|
|
||||||
FreeLibrary(hlib);
|
FreeLibrary(hlib);
|
||||||
|
|
||||||
hlib = NULL;
|
hlib = NULL;
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
|
int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user