summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-18 07:08:34 +0200
committerVolker Lendecke <vl@samba.org>2009-05-18 07:13:04 +0200
commitf140bf2e6578e45b8603d4a6c5feef9a3b735804 (patch)
tree997ccc284229fbabc6b40f58ddd2972f2afc6679 /source3/rpc_client
parent795b896ab083bb0c8336f91f0b8275ee5ef74fc1 (diff)
downloadsamba-f140bf2e6578e45b8603d4a6c5feef9a3b735804.tar.gz
samba-f140bf2e6578e45b8603d4a6c5feef9a3b735804.tar.bz2
samba-f140bf2e6578e45b8603d4a6c5feef9a3b735804.zip
Fix broken pipe handling
Metze is right: If we have *any* error at the socket level, we just can not continue. Also, apply some defensive programming: With this async stuff someone else might already have closed the socket.
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/rpc_transport_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/rpc_client/rpc_transport_sock.c b/source3/rpc_client/rpc_transport_sock.c
index 3756f73e50..4ab6500900 100644
--- a/source3/rpc_client/rpc_transport_sock.c
+++ b/source3/rpc_client/rpc_transport_sock.c
@@ -82,7 +82,7 @@ static void rpc_sock_read_done(struct tevent_req *subreq)
state->received = async_recv_recv(subreq, &err);
if (state->received == -1) {
- if (err == EPIPE) {
+ if (state->transp->fd != -1) {
close(state->transp->fd);
state->transp->fd = -1;
}
@@ -152,7 +152,7 @@ static void rpc_sock_write_done(struct tevent_req *subreq)
state->sent = async_send_recv(subreq, &err);
if (state->sent == -1) {
- if (err == EPIPE) {
+ if (state->transp->fd != -1) {
close(state->transp->fd);
state->transp->fd = -1;
}