This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Upgrade evcom - disable EPIPE error output.

  • Loading branch information...
ry committed Sep 4, 2009
1 parent 1bd5277 commit 2097b9d2e532624ab96cb548ac81d370bceea9fe
Showing with 16 additions and 9 deletions.
  1. +16 −9 deps/evcom/evcom.c
View
@@ -605,16 +605,20 @@ stream_send__data (evcom_stream *stream)
}
if (sent <= 0) {
- if (errno == EAGAIN || errno == EINTR) {
- assert(stream->send_action == stream_send__data);
- return AGAIN;
- }
-
- stream->errorno = errno;
- evcom_perror("send()", errno);
+ switch (errno) {
+ case EAGAIN:
+ case EINTR:
+ assert(stream->send_action == stream_send__data);
+ return AGAIN;
- stream->send_action = stream_send__close;
- return OKAY;
+ default:
+ stream->errorno = errno;
+ evcom_perror("send()", errno);
+ /* pass through */
+ case EPIPE:
+ stream->send_action = stream_send__close;
+ return OKAY;
+ }
}
ev_timer_again(D_LOOP_(stream) &stream->timeout_watcher);
@@ -1151,6 +1155,9 @@ evcom_stream_write (evcom_stream *stream, const char *str, size_t len)
if (sent < 0) {
switch (errno) {
+ case EPIPE:
+ goto close;
+
case EINTR:
case EAGAIN:
sent = 0;

0 comments on commit 2097b9d

Please sign in to comment.