From aa70e44cd0576e5280e24cf35000369a47dd958f Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 19 May 2009 01:13:36 +0800 Subject: s3: tevent_req_poll() loops forever when pipe is broken Signed-off-by: Bo Yang --- source3/libsmb/async_smb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 7afba0dae9..96b7054b87 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -742,6 +742,10 @@ static void cli_smb_sent(struct tevent_req *subreq) nwritten = writev_recv(subreq, &err); TALLOC_FREE(subreq); if (nwritten == -1) { + if (err == EPIPE) { + close(state->cli->fd); + state->cli->fd = -1; + } tevent_req_nterror(req, map_nt_error_from_unix(err)); return; } @@ -787,6 +791,10 @@ 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) { + close(cli->fd); + cli->fd = -1; + } status = map_nt_error_from_unix(err); goto fail; } -- cgit