diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:59 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:31:02 +0100 |
commit | 83bf46f4066e3d5e838a32357c201de9bd6ecdfd (patch) | |
tree | 65f491f7661bd533398625e015f2b5e5bff3badf /src/responder/common/responder_dp.c | |
parent | 45a1d9d597df977354428440aeff11c6a0a947fe (diff) | |
download | sssd-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/responder/common/responder_dp.c')
-rw-r--r-- | src/responder/common/responder_dp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c index 396c80997..a9b4ae23a 100644 --- a/src/responder/common/responder_dp.c +++ b/src/responder/common/responder_dp.c @@ -142,18 +142,19 @@ void handle_requests_after_reconnect(struct resp_ctx *rctx) struct sss_dp_req *sdp_req; if (!rctx->dp_request_table) { - DEBUG(7, "No requests to handle after reconnect\n"); + DEBUG(SSSDBG_TRACE_LIBS, "No requests to handle after reconnect\n"); return; } ret = hash_values(rctx->dp_request_table, &count, &values); if (ret != HASH_SUCCESS) { - DEBUG(1, "hash_values failed, " + DEBUG(SSSDBG_CRIT_FAILURE, "hash_values failed, " "not all request might be handled after reconnect.\n"); return; } - DEBUG(7, "Will handle %lu requests after reconnect\n", count); + DEBUG(SSSDBG_TRACE_LIBS, + "Will handle %lu requests after reconnect\n", count); for (i=0; i<count; i++) { sdp_req = talloc_get_type(values[i].ptr, struct sss_dp_req); talloc_free(sdp_req); @@ -197,7 +198,7 @@ static int sss_dp_get_reply(DBusPendingCall *pending, DBUS_TYPE_STRING, err_msg, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1,"Failed to parse message\n"); + DEBUG(SSSDBG_CRIT_FAILURE,"Failed to parse message\n"); /* FIXME: Destroy this connection ? */ if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); err = EIO; @@ -216,7 +217,7 @@ static int sss_dp_get_reply(DBusPendingCall *pending, err = ETIME; goto done; } - DEBUG(0,"The Data Provider returned an error [%s]\n", + DEBUG(SSSDBG_FATAL_FAILURE,"The Data Provider returned an error [%s]\n", dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: |