diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/db/sysdb_subdomains.c | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-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/db/sysdb_subdomains.c')
-rw-r--r-- | src/db/sysdb_subdomains.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 9c2926c00..e0ad22fd8 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -82,8 +82,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) name = ldb_msg_find_attr_as_string(res->msgs[i], "cn", NULL); if (name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EINVAL; goto done; } @@ -113,8 +113,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) /* in theory these may change, but it should never happen */ if (strcasecmp(dom->realm, realm) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Realm name changed from [%s] to [%s]!\n", - dom->realm, realm)); + "Realm name changed from [%s] to [%s]!\n", + dom->realm, realm); talloc_zfree(dom->realm); dom->realm = talloc_strdup(dom, realm); if (dom->realm == NULL) { @@ -124,8 +124,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->flat_name, flat) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Flat name changed from [%s] to [%s]!\n", - dom->flat_name, flat)); + "Flat name changed from [%s] to [%s]!\n", + dom->flat_name, flat); talloc_zfree(dom->flat_name); dom->flat_name = talloc_strdup(dom, flat); if (dom->flat_name == NULL) { @@ -135,8 +135,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->domain_id, id) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Domain changed from [%s] to [%s]!\n", - dom->domain_id, id)); + "Domain changed from [%s] to [%s]!\n", + dom->domain_id, id); talloc_zfree(dom->domain_id); dom->domain_id = talloc_strdup(dom, id); if (dom->domain_id == NULL) { @@ -147,17 +147,17 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) if (dom->mpg != mpg) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->mpg ? "true" : "false", - mpg ? "true" : "false")); + mpg ? "true" : "false"); dom->mpg = mpg; } if (dom->enumerate != enumerate) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->enumerate ? "true" : "false", - enumerate ? "true" : "false")); + enumerate ? "true" : "false"); dom->enumerate = enumerate; } @@ -165,8 +165,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) || (dom->forest != NULL && forest != NULL && strcasecmp(dom->forest, forest) != 0)) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Forest changed from [%s] to [%s]!\n", - dom->forest, forest)); + "Forest changed from [%s] to [%s]!\n", + dom->forest, forest); talloc_zfree(dom->forest); dom->forest = talloc_strdup(dom, forest); if (dom->forest == NULL) { @@ -235,8 +235,8 @@ errno_t sysdb_master_domain_update(struct sss_domain_info *domain) } if (res->count > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Base search returned [%d] results, " - "expected 1.\n", res->count)); + DEBUG(SSSDBG_OP_FAILURE, "Base search returned [%d] results, " + "expected 1.\n", res->count); ret = EINVAL; goto done; } @@ -385,9 +385,9 @@ errno_t sysdb_master_domain_add_info(struct sss_domain_info *domain, ret = ldb_modify(domain->sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", domain->name, ret, - ldb_errstring(domain->sysdb->ldb))); + ldb_errstring(domain->sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -624,9 +624,9 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb, ret = ldb_modify(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", name, ret, - ldb_errstring(sysdb->ldb))); + ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -651,7 +651,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name) goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Removing sub-domain [%s] from db.\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Removing sub-domain [%s] from db.\n", name); dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, name); if (dn == NULL) { ret = ENOMEM; @@ -660,7 +660,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name) ret = sysdb_delete_recursive(sysdb, dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_recursive failed.\n"); goto done; } |