diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-12-05 12:19:12 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-12-07 08:45:23 -0500 |
commit | 81b69919e1755180280c215468b4368d13024ea5 (patch) | |
tree | 786be57e27b908f7e090dc7cd7a9d1184ddca873 | |
parent | b1cf223317bb44da162bcfb153064281cdcbb56b (diff) | |
download | sssd-81b69919e1755180280c215468b4368d13024ea5.tar.gz sssd-81b69919e1755180280c215468b4368d13024ea5.tar.xz sssd-81b69919e1755180280c215468b4368d13024ea5.zip |
Always attempt to connect in sdap_async_sys_connect_done
This syncs up with Samba commit 50e30afa608dfdeae8a260730ead9761ed424dad
-rw-r--r-- | src/util/sss_ldap.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index afff22f16..0db83a4a6 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -201,32 +201,20 @@ static void sdap_async_sys_connect_done(struct tevent_context *ev, struct tevent_req *req = talloc_get_type(priv, struct tevent_req); struct sdap_async_sys_connect_state *state = tevent_req_data(req, struct sdap_async_sys_connect_state); - int ret = EOK; + int ret; int fret; - /* I found the following comment in samba's lib/async_req/async_sock.c: - * Stevens, Network Programming says that if there's a - * successful connect, the socket is only writable. Upon an - * error, it's both readable and writable. - */ - if ((flags & (TEVENT_FD_READ|TEVENT_FD_WRITE)) == - (TEVENT_FD_READ|TEVENT_FD_WRITE)) { - - ret = connect(state->fd, (struct sockaddr *) &state->addr, - state->addr_len); - if (ret == EOK) { - goto done; - } - + errno = 0; + ret = connect(state->fd, (struct sockaddr *) &state->addr, + state->addr_len); + if (ret != EOK) { ret = errno; if (ret == EINPROGRESS || ret == EINTR) { - return; + return; /* Try again later */ } - DEBUG(1, ("connect failed [%d][%s].\n", ret, strerror(ret))); } -done: talloc_zfree(fde); fret = fcntl(state->fd, F_SETFL, state->old_flags); |