Skip to content
Snippets Groups Projects
Commit f5b8a26d authored by Gisle Vanem's avatar Gisle Vanem
Browse files

errrno can by freak accident become EINTR on DOS or

Windows (unrelated to select). select() can never set errno
to EINTR on Windows.
parent cf51f7fb
No related branches found
No related tags found
No related merge requests found
...@@ -39,13 +39,17 @@ ...@@ -39,13 +39,17 @@
#error "We can't compile without select() support!" #error "We can't compile without select() support!"
#endif #endif
#include "select.h"
#ifdef __BEOS__ #ifdef __BEOS__
/* BeOS has FD_SET defined in socket.h */ /* BeOS has FD_SET defined in socket.h */
#include <socket.h> #include <socket.h>
#endif #endif
#include <curl/curl.h>
#include "urldata.h"
#include "connect.h"
#include "select.h"
#ifdef WIN32 #ifdef WIN32
#define VALID_SOCK(s) (1) /* Win-sockets are not in range [0..FD_SETSIZE> */ #define VALID_SOCK(s) (1) /* Win-sockets are not in range [0..FD_SETSIZE> */
#else #else
...@@ -148,7 +152,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms) ...@@ -148,7 +152,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
do { do {
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout); r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
} while((r == -1) && (errno == EINTR)); } while((r == -1) && (Curl_ourerrno() == EINTR));
if (r < 0) if (r < 0)
return -1; return -1;
...@@ -233,7 +237,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms) ...@@ -233,7 +237,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
do { do {
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout); r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
} while((r == -1) && (errno == EINTR)); } while((r == -1) && (Curl_ourerrno() == EINTR));
if (r < 0) if (r < 0)
return -1; return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment