diff options
author | rubidium <rubidium@openttd.org> | 2013-11-22 21:41:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-22 21:41:19 +0000 |
commit | fad4fa09ba173a6be76954acdbdb158a6232d0b0 (patch) | |
tree | 1db3633277a050360d5df5e01ee8d529ca33239e /src/network/core/tcp.cpp | |
parent | b37d402b2ded835c1a9905958e40587601615309 (diff) | |
download | openttd-fad4fa09ba173a6be76954acdbdb158a6232d0b0.tar.xz |
(svn r26046) -Fix: handle a number of failure conditions from methods called in the network code
Diffstat (limited to 'src/network/core/tcp.cpp')
-rw-r--r-- | src/network/core/tcp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp index 8cfa2d60e..e68c354fc 100644 --- a/src/network/core/tcp.cpp +++ b/src/network/core/tcp.cpp @@ -237,9 +237,9 @@ bool NetworkTCPSocketHandler::CanSendReceive() tv.tv_sec = tv.tv_usec = 0; // don't block at all. #if !defined(__MORPHOS__) && !defined(__AMIGA__) - select(FD_SETSIZE, &read_fd, &write_fd, NULL, &tv); + if (select(FD_SETSIZE, &read_fd, &write_fd, NULL, &tv) < 0) return false; #else - WaitSelect(FD_SETSIZE, &read_fd, &write_fd, NULL, &tv, NULL); + if (WaitSelect(FD_SETSIZE, &read_fd, &write_fd, NULL, &tv, NULL) < 0) return false; #endif this->writable = !!FD_ISSET(this->sock, &write_fd); |