[SSSD] [PATCH] Reset run_online_cb flag even if there are no callbacks

Sumit Bose sbose at redhat.com
Thu May 20 11:24:48 UTC 2010


Hi,

this patch will reduce the number of log messages if there are no
online callbacks and makes sure the run_online_cb flag has always the
right value.

bye,
Sumit
-------------- next part --------------
From 46f2b6482205171ec8dffe61ae93e57efcfe299a Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Thu, 20 May 2010 13:18:30 +0200
Subject: [PATCH] Reset run_online_cb flag even if there are no callbacks

---
 src/providers/data_provider_callbacks.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/providers/data_provider_callbacks.c b/src/providers/data_provider_callbacks.c
index 5552713..8ed2e5b 100644
--- a/src/providers/data_provider_callbacks.c
+++ b/src/providers/data_provider_callbacks.c
@@ -163,21 +163,23 @@ int be_add_online_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t cb,
 void be_run_online_cb(struct be_ctx *be) {
     int ret;
 
-    if (be->run_online_cb && be->online_cb_list) {
+    if (be->run_online_cb) {
         /* Reset the flag. We only want to run these
          * callbacks when transitioning to online
          */
         be->run_online_cb = false;
 
-        DEBUG(3, ("Going online. Running callbacks.\n"));
+        if (be->online_cb_list) {
+            DEBUG(3, ("Going online. Running callbacks.\n"));
 
-        ret = be_run_cb(be, be->online_cb_list);
-        if (ret != EOK) {
-            DEBUG(1, ("be_run_cb failed.\n"));
-        }
+            ret = be_run_cb(be, be->online_cb_list);
+            if (ret != EOK) {
+                DEBUG(1, ("be_run_cb failed.\n"));
+            }
 
-    } else {
-        DEBUG(9, ("Online call back list is empty, nothing to do.\n"));
+        } else {
+            DEBUG(9, ("Online call back list is empty, nothing to do.\n"));
+        }
     }
 }
 
-- 
1.6.6.1



More information about the sssd-devel mailing list