diff options
author | Jeffrey Hutzelman <jhutz@cmu.edu> | 2012-05-10 13:53:19 -0400 |
---|---|---|
committer | Jeffrey Hutzelman <jhutz@cmu.edu> | 2012-05-10 18:34:23 -0400 |
commit | 2a3b27757b6be826fd69a9d61b10a3f3b1972cbf (patch) | |
tree | b66619a288a405706bd39c4c0f8d6e9bac31ec85 /util | |
parent | e7e34388a582e93319313e37cb8ab421f6151a87 (diff) |
Treat ECONNREFUSED as EOF
Solaris may return ECONNREFUSED when reading from a stream socket when the
remote end has already been closed. Treat this as EOF and close down our
end of the connection, instead of sitting around forever.
Diffstat (limited to 'util')
-rw-r--r-- | util/tokens.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/tokens.c b/util/tokens.c index 4682116..b799c0e 100644 --- a/util/tokens.c +++ b/util/tokens.c @@ -35,6 +35,9 @@ map_socket_error(int err) { switch (err) { case EPIPE: return TOKEN_FAIL_EOF; +#ifdef ECONNRESET + case ECONNRESET:return TOKEN_FAIL_EOF; +#endif case ETIMEDOUT: return TOKEN_FAIL_TIMEOUT; default: return TOKEN_FAIL_SOCKET; } |