@@ -58,20 +58,6 @@ struct uv__stream_select_s { |
58 | 58 | fd_set* swrite; |
59 | 59 | size_t swrite_sz; |
60 | 60 | }; |
61 | | - |
62 | | -/* Due to a possible kernel bug at least in OS X 10.10 "Yosemite", |
63 | | - * EPROTOTYPE can be returned while trying to write to a socket that is |
64 | | - * shutting down. If we retry the write, we should get the expected EPIPE |
65 | | - * instead. |
66 | | - */ |
67 | | -# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR || errno == EPROTOTYPE) |
68 | | -# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \ |
69 | | - (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS || \ |
70 | | - (errno == EMSGSIZE && send_handle != NULL)) |
71 | | -#else |
72 | | -# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR) |
73 | | -# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \ |
74 | | - (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) |
75 | 61 | #endif /* defined(__APPLE__) */ |
76 | 62 |
|
77 | 63 | static void uv__stream_connect(uv_stream_t*); |
@@ -866,17 +852,17 @@ static int uv__try_write(uv_stream_t* stream, |
866 | 852 |
|
867 | 853 | do |
868 | 854 | n = sendmsg(uv__stream_fd(stream), &msg, 0); |
869 | | - while (n == -1 && RETRY_ON_WRITE_ERROR(errno)); |
| 855 | + while (n == -1 && errno == EINTR); |
870 | 856 | } else { |
871 | 857 | do |
872 | 858 | n = uv__writev(uv__stream_fd(stream), iov, iovcnt); |
873 | | - while (n == -1 && RETRY_ON_WRITE_ERROR(errno)); |
| 859 | + while (n == -1 && errno == EINTR); |
874 | 860 | } |
875 | 861 |
|
876 | 862 | if (n >= 0) |
877 | 863 | return n; |
878 | 864 |
|
879 | | - if (IS_TRANSIENT_WRITE_ERROR(errno, send_handle)) |
| 865 | + if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) |
880 | 866 | return UV_EAGAIN; |
881 | 867 |
|
882 | 868 | return UV__ERR(errno); |
|