summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-common.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-03-09 19:25:55 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-03-09 19:25:55 +0000
commitb945f54411dfde6992f65233e2974b1a1b5b87d3 (patch)
tree4c8a1d2715344dc0ca1b04431ed9fa268cfc0f43 /hcid/dbus-common.c
parent30471a2ebac1d103ff75a25e36315afd9ac76c46 (diff)
Coding style fixes
Diffstat (limited to 'hcid/dbus-common.c')
-rw-r--r--hcid/dbus-common.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index 35807330..439d9b57 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -85,7 +85,7 @@ static int name_data_add(const char *name, name_cb_t func, void *user_data)
cb = malloc(sizeof(struct name_callback));
if (!cb)
- goto out;
+ return 0;
cb->func = func;
cb->user_data = user_data;
@@ -95,13 +95,13 @@ static int name_data_add(const char *name, name_cb_t func, void *user_data)
data = malloc(sizeof(struct name_data));
if (!data) {
free(cb);
- goto out;
+ return 0;
}
data->name = strdup(name);
if (!data->name) {
free(cb);
- goto out;
+ return 0;
}
data->callbacks = NULL;
@@ -111,7 +111,6 @@ static int name_data_add(const char *name, name_cb_t func, void *user_data)
data->callbacks = slist_append(data->callbacks, cb);
-out:
return first;
}
@@ -154,7 +153,7 @@ static DBusHandlerResult name_exit_filter(DBusConnection *connection,
if (!dbus_message_is_signal(message,
DBUS_INTERFACE_DBUS,
"NameOwnerChanged"))
- goto out;
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (!dbus_message_get_args(message, NULL,
DBUS_TYPE_STRING, &name,
@@ -162,18 +161,18 @@ static DBusHandlerResult name_exit_filter(DBusConnection *connection,
DBUS_TYPE_STRING, &new,
DBUS_TYPE_INVALID)) {
syslog(LOG_ERR, "Invalid arguments for NameOwnerChanged signal");
- goto out;
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
/* We are not interested of service creations */
if (*new != '\0')
- goto out;
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
data = name_data_find(name);
if (!data) {
syslog(LOG_ERR, "Got NameOwnerChanged signal for %s which has no listeners",
name);
- goto out;
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
for (l = data->callbacks; l != NULL; l = l->next) {
@@ -184,11 +183,9 @@ static DBusHandlerResult name_exit_filter(DBusConnection *connection,
name_listeners = slist_remove(name_listeners, data);
name_data_free(data);
-out:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-
int name_listener_add(DBusConnection *connection, const char *name,
name_cb_t func, void *user_data)
{
@@ -277,4 +274,3 @@ int name_listener_remove(DBusConnection *connection, const char *name,
return 0;
}
-