summaryrefslogtreecommitdiffstats
path: root/src/util/nscd.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-02-12 22:30:55 +0100
commita3c8390d19593b1e5277d95bfb4ab206d4785150 (patch)
tree2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/util/nscd.c
parentcc026fd9ba386f2197e3217940d597dcad1a26fe (diff)
downloadsssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz
sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz
sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.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: 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/nscd.c')
-rw-r--r--src/util/nscd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util/nscd.c b/src/util/nscd.c
index 6c9cc7761..e73c3fa6c 100644
--- a/src/util/nscd.c
+++ b/src/util/nscd.c
@@ -49,7 +49,7 @@ int flush_nscd_cache(enum nscd_db flush_db)
break;
default:
- DEBUG(1, ("Unknown nscd database\n"));
+ DEBUG(1, "Unknown nscd database\n");
ret = EINVAL;
goto done;
}
@@ -59,10 +59,10 @@ int flush_nscd_cache(enum nscd_db flush_db)
case 0:
execl(NSCD_PATH, "nscd", NSCD_RELOAD_ARG, service, NULL);
/* if this returns it is an error */
- DEBUG(1, ("execl(3) failed: %d(%s)\n", errno, strerror(errno)));
+ DEBUG(1, "execl(3) failed: %d(%s)\n", errno, strerror(errno));
exit(errno);
case -1:
- DEBUG(1, ("fork failed\n"));
+ DEBUG(1, "fork failed\n");
ret = EFAULT;
break;
default:
@@ -76,11 +76,11 @@ int flush_nscd_cache(enum nscd_db flush_db)
if (ret > 0) {
/* The flush fails if nscd is not running, so do not care
* about the return code */
- DEBUG(8, ("Error flushing cache, is nscd running?\n"));
+ DEBUG(8, "Error flushing cache, is nscd running?\n");
}
}
} else {
- DEBUG(5, ("Failed to wait for children %d\n", nscd_pid));
+ DEBUG(5, "Failed to wait for children %d\n", nscd_pid);
ret = EIO;
}
}
@@ -140,8 +140,8 @@ errno_t sss_nscd_parse_conf(const char *conf_path)
fp = fopen(conf_path, "r");
if (fp == NULL) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("Couldn't open NSCD configuration "
- "file [%s]\n", NSCD_CONF_PATH));
+ DEBUG(SSSDBG_MINOR_FAILURE, "Couldn't open NSCD configuration "
+ "file [%s]\n", NSCD_CONF_PATH);
return ENOENT;
}
@@ -196,9 +196,9 @@ errno_t sss_nscd_parse_conf(const char *conf_path)
ret = ferror(fp);
if (ret) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("Reading NSCD configuration file [%s] "
+ DEBUG(SSSDBG_MINOR_FAILURE, "Reading NSCD configuration file [%s] "
"ended with failure [%d]: %s.\n",
- NSCD_CONF_PATH, ret, strerror(ret)));
+ NSCD_CONF_PATH, ret, strerror(ret));
ret = ENOENT;
goto done;
}