summaryrefslogtreecommitdiffstats
path: root/src/providers/data_provider_callbacks.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-02-12 10:12:59 -0500
committerJakub Hrozek <jhrozek@redhat.com>2014-02-12 22:31:02 +0100
commit83bf46f4066e3d5e838a32357c201de9bd6ecdfd (patch)
tree65f491f7661bd533398625e015f2b5e5bff3badf /src/providers/data_provider_callbacks.c
parent45a1d9d597df977354428440aeff11c6a0a947fe (diff)
downloadsssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.tar.gz
sssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.tar.xz
sssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.zip
Update DEBUG* invocations to use new levels
Use a script to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/providers/data_provider_callbacks.c')
-rw-r--r--src/providers/data_provider_callbacks.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/providers/data_provider_callbacks.c b/src/providers/data_provider_callbacks.c
index d765acf70..327d41f1b 100644
--- a/src/providers/data_provider_callbacks.c
+++ b/src/providers/data_provider_callbacks.c
@@ -104,7 +104,8 @@ static void be_run_cb_step(struct tevent_context *ev, struct tevent_timer *te,
be_run_cb_step,
cb_ctx);
if (!tev) {
- DEBUG(0, "Out of memory. Could not invoke callbacks\n");
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ "Out of memory. Could not invoke callbacks\n");
goto final;
}
return;
@@ -130,7 +131,8 @@ static errno_t be_run_cb(struct be_ctx *be, struct be_cb *cb_list)
cb_ctx = talloc(be, struct be_cb_ctx);
if (!cb_ctx) {
- DEBUG(0, "Out of memory. Could not invoke callbacks\n");
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ "Out of memory. Could not invoke callbacks\n");
return ENOMEM;
}
cb_ctx->be = be;
@@ -142,7 +144,8 @@ static errno_t be_run_cb(struct be_ctx *be, struct be_cb *cb_list)
be_run_cb_step,
cb_ctx);
if (!te) {
- DEBUG(0, "Out of memory. Could not invoke callbacks\n");
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ "Out of memory. Could not invoke callbacks\n");
talloc_free(cb_ctx);
return ENOMEM;
}
@@ -196,7 +199,7 @@ int be_add_online_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t cb,
ret = be_add_cb(mem_ctx, ctx, cb, pvt, &ctx->online_cb_list, online_cb);
if (ret != EOK) {
- DEBUG(1, "be_add_cb failed.\n");
+ DEBUG(SSSDBG_CRIT_FAILURE, "be_add_cb failed.\n");
return ret;
}
@@ -218,15 +221,16 @@ void be_run_online_cb(struct be_ctx *be) {
be->run_online_cb = false;
if (be->online_cb_list) {
- DEBUG(3, "Going online. Running callbacks.\n");
+ DEBUG(SSSDBG_MINOR_FAILURE, "Going online. Running callbacks.\n");
ret = be_run_cb(be, be->online_cb_list);
if (ret != EOK) {
- DEBUG(1, "be_run_cb failed.\n");
+ DEBUG(SSSDBG_CRIT_FAILURE, "be_run_cb failed.\n");
}
} else {
- DEBUG(9, "Online call back list is empty, nothing to do.\n");
+ DEBUG(SSSDBG_TRACE_ALL,
+ "Online call back list is empty, nothing to do.\n");
}
}
}
@@ -268,14 +272,15 @@ void be_run_offline_cb(struct be_ctx *be) {
int ret;
if (be->offline_cb_list) {
- DEBUG(3, "Going offline. Running callbacks.\n");
+ DEBUG(SSSDBG_MINOR_FAILURE, "Going offline. Running callbacks.\n");
ret = be_run_cb(be, be->offline_cb_list);
if (ret != EOK) {
- DEBUG(1, "be_run_cb failed.\n");
+ DEBUG(SSSDBG_CRIT_FAILURE, "be_run_cb failed.\n");
}
} else {
- DEBUG(9, "Offline call back list is empty, nothing to do.\n");
+ DEBUG(SSSDBG_TRACE_ALL,
+ "Offline call back list is empty, nothing to do.\n");
}
}