summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/async_smb.c4
-rw-r--r--source3/rpc_client/rpc_transport_sock.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 96b7054b87..12bc0a6fb3 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -742,7 +742,7 @@ static void cli_smb_sent(struct tevent_req *subreq)
nwritten = writev_recv(subreq, &err);
TALLOC_FREE(subreq);
if (nwritten == -1) {
- if (err == EPIPE) {
+ if (state->cli->fd != -1) {
close(state->cli->fd);
state->cli->fd = -1;
}
@@ -791,7 +791,7 @@ static void cli_smb_received(struct tevent_req *subreq)
received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
TALLOC_FREE(subreq);
if (received == -1) {
- if (err == EPIPE) {
+ if (cli->fd != -1) {
close(cli->fd);
cli->fd = -1;
}
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;
}