summaryrefslogtreecommitdiffstats
path: root/src/util/debug.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-02-12 10:12:04 -0500
committerJakub Hrozek <jhrozek@redhat.com>2014-05-02 10:58:19 +0200
commitb0d759c9a604add0573c04b1a4e88e1605e1fdc0 (patch)
tree15c83ce34cd254a30cc42c212123b7f194c21677 /src/util/debug.c
parentb9afd88065ecdb9c2cafb2ee767bd61585b31b8f (diff)
downloadsssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.gz
sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.xz
sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.zip
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code (identical to commit a3c8390d19593b1e5277d95bfb4ab206d4785150): grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; 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/util/debug.c')
-rw-r--r--src/util/debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index 4c49dc662..278cd87ce 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -50,7 +50,7 @@ errno_t set_debug_file_from_fd(const int fd)
dummy = fdopen(fd, "a");
if (dummy == NULL) {
ret = errno;
- DEBUG(1, ("fdopen failed [%d][%s].\n", ret, strerror(ret)));
+ DEBUG(1, "fdopen failed [%d][%s].\n", ret, strerror(ret));
sss_log(SSS_LOG_ERR,
"Could not open debug file descriptor [%d]. "
"Debug messages will not be written to the file "
@@ -323,5 +323,5 @@ int rotate_debug_files(void)
void talloc_log_fn(const char *message)
{
- DEBUG(SSSDBG_FATAL_FAILURE, ("%s", message));
+ DEBUG(SSSDBG_FATAL_FAILURE, "%s", message);
}