diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-03-21 18:04:04 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-03-21 18:04:04 +0000 |
commit | 11676370a14d77b9fc04af03143fe56ab58753cd (patch) | |
tree | 601baf3e0252622419117db215e3a1e4577ee177 /network/connection.c | |
parent | 2bdadb9a01d23b0118161dfc598cc688ef5719e5 (diff) |
Remove duplicate code and some minor fixes.
Diffstat (limited to 'network/connection.c')
-rw-r--r-- | network/connection.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/network/connection.c b/network/connection.c index e6d4d221..c1544b58 100644 --- a/network/connection.c +++ b/network/connection.c @@ -38,7 +38,10 @@ #include "connection.h" struct network_conn { + char *raddr; char *path; + char *uuid; + gboolean up; }; static DBusHandlerResult get_address(DBusConnection *conn, DBusMessage *msg, @@ -135,6 +138,9 @@ static void connection_free(struct network_conn *nc) if (nc->path) g_free(nc->path); + if (nc->uuid) + g_free(nc->uuid); + g_free(nc); } @@ -142,7 +148,7 @@ static void connection_unregister(DBusConnection *conn, void *data) { struct network_conn *nc = data; - info("Unregistered connection path %s", nc->path); + info("Unregistered connection path:%s", nc->path); connection_free(nc); } @@ -153,7 +159,8 @@ static const DBusObjectPathVTable connection_table = { .unregister_function = connection_unregister, }; -int connection_register(DBusConnection *conn, const char *path) +int connection_register(DBusConnection *conn, const char *path, + const char *addr, const char *uuid) { struct network_conn *nc; @@ -170,8 +177,10 @@ int connection_register(DBusConnection *conn, const char *path) } nc->path = g_strdup(path); + nc->raddr = g_strdup(addr); + nc->uuid = g_strdup(uuid); + nc->up = FALSE; info("Registered connection path:%s", path); - return 0; fail: connection_free(nc); |