summaryrefslogtreecommitdiff
path: root/lib/tsocket
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-04-03 14:29:51 +0200
committerStefan Metzmacher <metze@samba.org>2009-04-06 15:49:08 +0200
commit9d9f9452815f99dae61976b843af14f54c42009c (patch)
tree903920a74b4a010ed891c5f9bee43a86fb583a3a /lib/tsocket
parent89278b18195484d3ea5d25e8b19871d64d218a05 (diff)
downloadsamba-9d9f9452815f99dae61976b843af14f54c42009c.tar.gz
samba-9d9f9452815f99dae61976b843af14f54c42009c.tar.bz2
samba-9d9f9452815f99dae61976b843af14f54c42009c.zip
tsocket: use the correct 'ret' variable for tdgram_disconnect_send/recv()
metze
Diffstat (limited to 'lib/tsocket')
-rw-r--r--lib/tsocket/tsocket_bsd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 4ccaff46e3..6d27ccae22 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -1658,7 +1658,7 @@ static ssize_t tdgram_bsd_sendto_recv(struct tevent_req *req, int *perrno)
}
struct tdgram_bsd_disconnect_state {
- int ret;
+ void *__dummy;
};
static struct tevent_req *tdgram_bsd_disconnect_send(TALLOC_CTX *mem_ctx,
@@ -1677,7 +1677,6 @@ static struct tevent_req *tdgram_bsd_disconnect_send(TALLOC_CTX *mem_ctx,
if (req == NULL) {
return NULL;
}
- state->ret = -1;
if (bsds->read_req || bsds->write_req) {
tevent_req_error(req, EBUSY);
@@ -1689,7 +1688,7 @@ static struct tevent_req *tdgram_bsd_disconnect_send(TALLOC_CTX *mem_ctx,
goto post;
}
- state->ret = close(bsds->fd);
+ ret = close(bsds->fd);
bsds->fd = -1;
err = tsocket_error_from_errno(ret, errno, &dummy);
if (tevent_req_error(req, err)) {
@@ -1705,14 +1704,9 @@ post:
static int tdgram_bsd_disconnect_recv(struct tevent_req *req,
int *perrno)
{
- struct tdgram_bsd_disconnect_state *state = tevent_req_data(req,
- struct tdgram_bsd_disconnect_state);
int ret;
ret = tsocket_simple_int_recv(req, perrno);
- if (ret == 0) {
- ret = state->ret;
- }
tevent_req_received(req);
return ret;