]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbindd_cm: use cli_state_is_connected() helper function
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Mar 2010 14:14:02 +0000 (15:14 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 13 Apr 2010 18:18:52 +0000 (20:18 +0200)
metze
(cherry picked from commit 408a3eb35a0e61b5d66a3b48ebbd1a6796672d0f)
(cherry picked from commit 00a93190d2cae31cd2213b810ea348c055670399)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd_cm.c

index 481d98551724669266db50b5e1f019bf506499e8..ce7f543012552689587197682b8b76856a989eb5 100644 (file)
@@ -1592,21 +1592,11 @@ void close_conns_after_fork(void)
 
 static bool connection_ok(struct winbindd_domain *domain)
 {
-       if (domain->conn.cli == NULL) {
-               DEBUG(8, ("connection_ok: Connection to %s for domain %s has NULL "
-                         "cli!\n", domain->dcname, domain->name));
-               return False;
-       }
-
-       if (!domain->conn.cli->initialised) {
-               DEBUG(3, ("connection_ok: Connection to %s for domain %s was never "
-                         "initialised!\n", domain->dcname, domain->name));
-               return False;
-       }
+       bool ok;
 
-       if (domain->conn.cli->fd == -1) {
-               DEBUG(3, ("connection_ok: Connection to %s for domain %s has died or was "
-                         "never started (fd == -1)\n", 
+       ok = cli_state_is_connected(domain->conn.cli);
+       if (!ok) {
+               DEBUG(3, ("connection_ok: Connection to %s for domain %s is not connected\n",
                          domain->dcname, domain->name));
                return False;
        }