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/sbus/sssd_dbus_server.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/sbus/sssd_dbus_server.c')
-rw-r--r-- | src/sbus/sssd_dbus_server.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/sbus/sssd_dbus_server.c b/src/sbus/sssd_dbus_server.c index 597118973..a7efd1f3c 100644 --- a/src/sbus/sssd_dbus_server.c +++ b/src/sbus/sssd_dbus_server.c @@ -45,25 +45,25 @@ static void sbus_server_init_new_connection(DBusServer *dbus_server, struct sbus_connection *conn; int ret; - DEBUG(5,("Entering.\n")); + DEBUG(5,"Entering.\n"); server = talloc_get_type(data, struct sbus_connection); if (!server) { return; } - DEBUG(5,("Adding connection %p.\n", dbus_conn)); + DEBUG(5,"Adding connection %p.\n", dbus_conn); ret = sbus_init_connection(server, server->ev, dbus_conn, server->server_intf, SBUS_CONN_TYPE_PRIVATE, &conn); if (ret != 0) { dbus_connection_close(dbus_conn); - DEBUG(5,("Closing connection (failed setup)")); + DEBUG(5,"Closing connection (failed setup)"); return; } dbus_connection_ref(dbus_conn); - DEBUG(5,("Got a connection\n")); + DEBUG(5,"Got a connection\n"); /* * Initialize connection-specific features @@ -75,7 +75,7 @@ static void sbus_server_init_new_connection(DBusServer *dbus_server, */ ret = server->srv_init_fn(conn, server->srv_init_data); if (ret != EOK) { - DEBUG(1,("Initialization failed!\n")); + DEBUG(1,"Initialization failed!\n"); dbus_connection_close(dbus_conn); talloc_zfree(conn); } @@ -97,8 +97,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename) { errno_t ret; - DEBUG(7, ("Symlinking the dbus path %s to a link %s\n", - filename, symlink_filename)); + DEBUG(7, "Symlinking the dbus path %s to a link %s\n", + filename, symlink_filename); errno = 0; ret = symlink(filename, symlink_filename); if (ret != 0 && errno == EEXIST) { @@ -107,8 +107,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename) ret = unlink(symlink_filename); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot remove old symlink: [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "Cannot remove old symlink: [%d][%s].\n", + ret, strerror(ret)); return EIO; } errno = 0; @@ -117,8 +117,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename) if (ret != 0) { ret = errno; - DEBUG(1, ("symlink() failed on file '%s': [%d][%s].\n", - filename, ret, strerror(ret))); + DEBUG(1, "symlink() failed on file '%s': [%d][%s].\n", + filename, ret, strerror(ret)); return EIO; } @@ -137,28 +137,28 @@ remove_socket_symlink(const char *symlink_name) numread = readlink(symlink_name, target, PATH_MAX-1); if (numread < 0) { ret = errno; - DEBUG(2, ("readlink failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(2, "readlink failed [%d]: %s\n", ret, strerror(ret)); return ret; } target[numread] = '\0'; - DEBUG(9, ("The symlink points to [%s]\n", target)); + DEBUG(9, "The symlink points to [%s]\n", target); /* We can only remove the symlink if it points to a socket with * the same PID */ ret = snprintf(pidpath, PATH_MAX, "%s.%lu", symlink_name, (unsigned long) getpid()); if (ret < 0) { - DEBUG(2, ("snprintf failed")); + DEBUG(2, "snprintf failed"); return EIO; } else if (ret >= PATH_MAX) { - DEBUG(2, ("path too long?!?!\n")); + DEBUG(2, "path too long?!?!\n"); return EIO; } - DEBUG(9, ("The path including our pid is [%s]\n", pidpath)); + DEBUG(9, "The path including our pid is [%s]\n", pidpath); if (strcmp(pidpath, target) != 0) { - DEBUG(4, ("Will not remove symlink, seems to be owned by " - "another process\n")); + DEBUG(4, "Will not remove symlink, seems to be owned by " + "another process\n"); return EOK; } @@ -166,12 +166,12 @@ remove_socket_symlink(const char *symlink_name) if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("unlink failed to remove [%s] [%d]: %s\n", - symlink_name, ret, strerror(ret))); + "unlink failed to remove [%s] [%d]: %s\n", + symlink_name, ret, strerror(ret)); return ret; } - DEBUG(9, ("Removed the symlink\n")); + DEBUG(9, "Removed the symlink\n"); return EOK; } @@ -216,8 +216,8 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, dbus_error_init(&dbus_error); dbus_server = dbus_server_listen(socket_address, &dbus_error); if (!dbus_server) { - DEBUG(1,("dbus_server_listen failed! (name=%s, message=%s)\n", - dbus_error.name, dbus_error.message)); + DEBUG(1,"dbus_server_listen failed! (name=%s, message=%s)\n", + dbus_error.name, dbus_error.message); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); ret = EIO; goto done; @@ -225,7 +225,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, filename = strchr(socket_address, '/'); if (filename == NULL) { - DEBUG(1, ("Unexpected dbus address [%s].\n", socket_address)); + DEBUG(1, "Unexpected dbus address [%s].\n", socket_address); ret = EIO; goto done; } @@ -233,15 +233,15 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, if (use_symlink) { symlink_filename = strchr(address, '/'); if (symlink_filename == NULL) { - DEBUG(1, ("Unexpected dbus address [%s].\n", address)); + DEBUG(1, "Unexpected dbus address [%s].\n", address); ret = EIO; goto done; } ret = create_socket_symlink(filename, symlink_filename); if (ret != EOK) { - DEBUG(1, ("Could not create symlink [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "Could not create symlink [%d]: %s\n", + ret, strerror(ret)); ret = EIO; goto done; } @@ -251,7 +251,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, * the socket */ ret = check_file(filename, 0, 0, -1, CHECK_SOCK, &stat_buf, true); if (ret != EOK) { - DEBUG(1, ("check_file failed for [%s].\n", filename)); + DEBUG(1, "check_file failed for [%s].\n", filename); ret = EIO; goto done; } @@ -259,15 +259,15 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, if ((stat_buf.st_mode & ~S_IFMT) != 0600) { ret = chmod(filename, 0600); if (ret != EOK) { - DEBUG(1, ("chmod failed for [%s]: [%d][%s].\n", filename, errno, - strerror(errno))); + DEBUG(1, "chmod failed for [%s]: [%d][%s].\n", filename, errno, + strerror(errno)); ret = EIO; goto done; } } tmp = dbus_server_get_address(dbus_server); - DEBUG(SSSDBG_TRACE_FUNC, ("D-BUS Server listening on %s\n", tmp)); + DEBUG(SSSDBG_TRACE_FUNC, "D-BUS Server listening on %s\n", tmp); free(tmp); server = talloc_zero(tmp_ctx, struct sbus_connection); @@ -305,7 +305,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, sbus_toggle_watch, server, NULL); if (!dbret) { - DEBUG(4, ("Error setting up D-BUS server watch functions\n")); + DEBUG(4, "Error setting up D-BUS server watch functions\n"); ret = EIO; goto done; } @@ -317,7 +317,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, sbus_toggle_timeout, server, NULL); if (!dbret) { - DEBUG(4,("Error setting up D-BUS server timeout functions\n")); + DEBUG(4,"Error setting up D-BUS server timeout functions\n"); dbus_server_set_watch_functions(server->dbus.server, NULL, NULL, NULL, NULL, NULL); ret = EIO; @@ -345,7 +345,7 @@ static int sbus_server_destructor(void *ctx) if (server->symlink) { ret = remove_socket_symlink(server->symlink); if (ret != EOK) { - DEBUG(3, ("Could not remove the server symlink\n")); + DEBUG(3, "Could not remove the server symlink\n"); } } |