Simplify to retry logic: if cm_prepare_connection() succeeded just exit the
retry loop, only if it failed check the "retry" variable.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
result = cm_prepare_connection(domain, fd, domain->dcname,
&new_conn->cli, &retry);
- if (!NT_STATUS_IS_OK(result)) {
- /* Don't leak the smb connection socket */
- if (fd != -1) {
- close(fd);
- fd = -1;
- }
+ if (NT_STATUS_IS_OK(result)) {
+ break;
}
-
- if (!retry)
+ close(fd);
+ fd = -1;
+ if (!retry) {
break;
+ }
}
if (!NT_STATUS_IS_OK(result)) {