aboutsummaryrefslogtreecommitdiff
path: root/src/usocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usocket.c')
-rw-r--r--src/usocket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/usocket.c b/src/usocket.c
index 2c30b9a..1ba1043 100644
--- a/src/usocket.c
+++ b/src/usocket.c
@@ -30,9 +30,9 @@ int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
30 pfd.revents = 0; 30 pfd.revents = 0;
31 if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */ 31 if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */
32 do { 32 do {
33 int t = (int)(timeout_getretry(tm)*1e3); 33 int t = (int)(timeout_getretry(tm)*1e3);
34 ret = poll(&pfd, 1, t >= 0? t: -1); 34 ret = poll(&pfd, 1, t >= 0? t: -1);
35 } while (ret == -1 && errno == EINTR); 35 } while (ret == -1 && errno == EINTR);
36 if (ret == -1) return errno; 36 if (ret == -1) return errno;
37 if (ret == 0) return IO_TIMEOUT; 37 if (ret == 0) return IO_TIMEOUT;
38 if (sw == WAITFD_C && (pfd.revents & (POLLIN|POLLERR))) return IO_CLOSED; 38 if (sw == WAITFD_C && (pfd.revents & (POLLIN|POLLERR))) return IO_CLOSED;