summaryrefslogtreecommitdiffstats
path: root/src/monitor/monitor_sbus.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/monitor/monitor_sbus.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/monitor/monitor_sbus.c')
-rw-r--r--src/monitor/monitor_sbus.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c
index 66270a7fa..d94116ef4 100644
--- a/src/monitor/monitor_sbus.c
+++ b/src/monitor/monitor_sbus.c
@@ -61,8 +61,8 @@ static void id_callback(DBusPendingCall *pending, void *ptr)
* until reply is valid or timeout has occurred. If reply is NULL
* here, something is seriously wrong and we should bail out.
*/
- DEBUG(0, ("Severe error. A reply callback was called but no"
- " reply was received and no timeout occurred\n"));
+ DEBUG(0, "Severe error. A reply callback was called but no"
+ " reply was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */
goto done;
@@ -75,19 +75,19 @@ static void id_callback(DBusPendingCall *pending, void *ptr)
DBUS_TYPE_UINT16, &mon_ver,
DBUS_TYPE_INVALID);
if (!ret) {
- DEBUG(1, ("Failed to parse message\n"));
+ DEBUG(1, "Failed to parse message\n");
if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
/* FIXME: Destroy this connection ? */
goto done;
}
- DEBUG(4, ("Got id ack and version (%d) from Monitor\n", mon_ver));
+ DEBUG(4, "Got id ack and version (%d) from Monitor\n", mon_ver);
break;
case DBUS_MESSAGE_TYPE_ERROR:
- DEBUG(0,("The Monitor returned an error [%s]\n",
- dbus_message_get_error_name(reply)));
+ DEBUG(0,"The Monitor returned an error [%s]\n",
+ dbus_message_get_error_name(reply));
/* Falling through to default intentionally*/
default:
/*
@@ -120,18 +120,18 @@ int monitor_common_send_id(struct sbus_connection *conn,
MON_SRV_INTERFACE,
MON_SRV_METHOD_REGISTER);
if (msg == NULL) {
- DEBUG(0, ("Out of memory?!\n"));
+ DEBUG(0, "Out of memory?!\n");
return ENOMEM;
}
- DEBUG(4, ("Sending ID: (%s,%d)\n", name, version));
+ DEBUG(4, "Sending ID: (%s,%d)\n", name, version);
ret = dbus_message_append_args(msg,
DBUS_TYPE_STRING, &name,
DBUS_TYPE_UINT16, &version,
DBUS_TYPE_INVALID);
if (!ret) {
- DEBUG(1, ("Failed to build message\n"));
+ DEBUG(1, "Failed to build message\n");
return EIO;
}
@@ -197,14 +197,14 @@ errno_t monitor_common_rotate_logs(struct confdb_ctx *confdb,
old_debug_level,
&debug_level);
if (ret != EOK) {
- DEBUG(0, ("Error reading from confdb (%d) [%s]\n",
- ret, strerror(ret)));
+ DEBUG(0, "Error reading from confdb (%d) [%s]\n",
+ ret, strerror(ret));
/* Try to proceed with the old value */
debug_level = old_debug_level;
}
if (debug_level != old_debug_level) {
- DEBUG(0, ("Debug level changed to %#.4x\n", debug_level));
+ DEBUG(0, "Debug level changed to %#.4x\n", debug_level);
debug_level = debug_convert_old_level(debug_level);
}
@@ -226,7 +226,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx,
/* Set up SBUS connection to the monitor */
ret = monitor_get_sbus_address(NULL, &sbus_address);
if (ret != EOK) {
- DEBUG(0, ("Could not locate monitor address.\n"));
+ DEBUG(0, "Could not locate monitor address.\n");
return ret;
}
@@ -234,7 +234,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx,
intf, &conn,
NULL, pvt);
if (ret != EOK) {
- DEBUG(0, ("Failed to connect to monitor services.\n"));
+ DEBUG(0, "Failed to connect to monitor services.\n");
talloc_free(sbus_address);
return ret;
}
@@ -243,7 +243,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx,
/* Identify ourselves to the monitor */
ret = monitor_common_send_id(conn, svc_name, svc_version);
if (ret != EOK) {
- DEBUG(0, ("Failed to identify to the monitor!\n"));
+ DEBUG(0, "Failed to identify to the monitor!\n");
return ret;
}