git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9569d97
)
Simplify async_connect_send slightly
author
Volker Lendecke
<vl@samba.org>
Sat, 28 Feb 2009 11:19:24 +0000
(12:19 +0100)
committer
Volker Lendecke
<vl@samba.org>
Sat, 28 Feb 2009 11:32:22 +0000
(12:32 +0100)
lib/async_req/async_sock.c
patch
|
blob
|
history
diff --git
a/lib/async_req/async_sock.c
b/lib/async_req/async_sock.c
index 40e7bca4c86da183de29bb3fce494615fac18b29..1f48697f26f825a729c618165b36f0846de4fd9e 100644
(file)
--- a/
lib/async_req/async_sock.c
+++ b/
lib/async_req/async_sock.c
@@
-268,8
+268,8
@@
struct tevent_req *async_connect_send(TALLOC_CTX *mem_ctx,
state->result = connect(fd, address, address_len);
if (state->result == 0) {
state->result = connect(fd, address, address_len);
if (state->result == 0) {
-
errno = 0
;
- goto
post_errno
;
+
tevent_req_done(result)
;
+ goto
done
;
}
/**
}
/**
@@
-284,25
+284,22
@@
struct tevent_req *async_connect_send(TALLOC_CTX *mem_ctx,
errno == EISCONN ||
#endif
errno == EAGAIN || errno == EINTR)) {
errno == EISCONN ||
#endif
errno == EAGAIN || errno == EINTR)) {
+ state->sys_errno = errno;
goto post_errno;
}
fde = tevent_add_fd(ev, state, fd, TEVENT_FD_READ | TEVENT_FD_WRITE,
async_connect_connected, result);
if (fde == NULL) {
goto post_errno;
}
fde = tevent_add_fd(ev, state, fd, TEVENT_FD_READ | TEVENT_FD_WRITE,
async_connect_connected, result);
if (fde == NULL) {
- errno = ENOMEM;
+
state->sys_
errno = ENOMEM;
goto post_errno;
}
return result;
post_errno:
goto post_errno;
}
return result;
post_errno:
- state->sys_errno = errno;
+ tevent_req_error(result, state->sys_errno);
+ done:
fcntl(fd, F_SETFL, state->old_sockflags);
fcntl(fd, F_SETFL, state->old_sockflags);
- if (state->sys_errno == 0) {
- tevent_req_done(result);
- } else {
- tevent_req_error(result, state->sys_errno);
- }
return tevent_req_post(result, ev);
}
return tevent_req_post(result, ev);
}