summaryrefslogtreecommitdiffstats
path: root/src/tools/sss_usermod.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/tools/sss_usermod.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/tools/sss_usermod.c')
-rw-r--r--src/tools/sss_usermod.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c
index e0ae99ea0..f3c2e1d63 100644
--- a/src/tools/sss_usermod.c
+++ b/src/tools/sss_usermod.c
@@ -70,7 +70,7 @@ int main(int argc, const char **argv)
ret = set_locale();
if (ret != EOK) {
- DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret)));
+ DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret));
ERROR("Error setting the locale\n");
ret = EXIT_FAILURE;
goto fini;
@@ -123,7 +123,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx);
if (ret != EOK) {
- DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret)));
+ DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
if (ret == ENOENT) {
ERROR("Error initializing the tools - no local domain\n");
} else {
@@ -158,7 +158,7 @@ int main(int argc, const char **argv)
if (addgroups) {
ret = parse_groups(tctx, addgroups, &tctx->octx->addgroups);
if (ret != EOK) {
- DEBUG(1, ("Cannot parse groups to add the user to\n"));
+ DEBUG(1, "Cannot parse groups to add the user to\n");
ERROR("Internal error while parsing parameters\n");
ret = EXIT_FAILURE;
goto fini;
@@ -166,7 +166,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->addgroups);
if (ret != EOK) {
- DEBUG(1, ("Cannot parse FQDN groups to add the user to\n"));
+ DEBUG(1, "Cannot parse FQDN groups to add the user to\n");
ERROR("Groups must be in the same domain as user\n");
ret = EXIT_FAILURE;
goto fini;
@@ -185,7 +185,7 @@ int main(int argc, const char **argv)
if (rmgroups) {
ret = parse_groups(tctx, rmgroups, &tctx->octx->rmgroups);
if (ret != EOK) {
- DEBUG(1, ("Cannot parse groups to remove the user from\n"));
+ DEBUG(1, "Cannot parse groups to remove the user from\n");
ERROR("Internal error while parsing parameters\n");
ret = EXIT_FAILURE;
goto fini;
@@ -193,7 +193,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->rmgroups);
if (ret != EOK) {
- DEBUG(1, ("Cannot parse FQDN groups to remove the user from\n"));
+ DEBUG(1, "Cannot parse FQDN groups to remove the user from\n");
ERROR("Groups must be in the same domain as user\n");
ret = EXIT_FAILURE;
goto fini;
@@ -218,7 +218,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_start(tctx->sysdb);
if (tctx->error != EOK) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n");
goto done;
}
in_transaction = true;
@@ -231,7 +231,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_commit(tctx->sysdb);
if (tctx->error) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n");
goto done;
}
in_transaction = false;
@@ -270,7 +270,7 @@ done:
if (in_transaction) {
sret = sysdb_transaction_cancel(tctx->sysdb);
if (sret != EOK) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n");
}
}