Diff between d8d4b4f0c0ed5ddce7df3cf7ddad8322a9787c45 and 0ab621bb86df7097c06178bf091b768e5b2e7a2b

Changed Files

File Additions Deletions Status
client/agent.c +8 -6 modified

Full Patch

diff --git a/client/agent.c b/client/agent.c
index 0a82e21..0deae1b 100644
--- a/client/agent.c
+++ b/client/agent.c
@@ -32,6 +32,9 @@
 #include "display.h"
 #include "agent.h"
 
+#define AGENT_PATH "/org/bluez/agent"
+#define AGENT_INTERFACE "org.bluez.Agent1"
+
 static gboolean agent_registered = FALSE;
 
 static DBusMessage *release_agent(DBusConnection *conn,
@@ -39,8 +42,7 @@ static DBusMessage *release_agent(DBusConnection *conn,
 {
 	agent_registered = FALSE;
 
-	g_dbus_unregister_interface(conn, "/org/bluez/agent",
-						"org.bluez.Agent1");
+	g_dbus_unregister_interface(conn, AGENT_PATH, AGENT_INTERFACE);
 
 	return dbus_message_new_method_return(msg);
 }
@@ -57,8 +59,8 @@ void agent_register(DBusConnection *conn, GDBusProxy *manager)
 		return;
 	}
 
-	if (g_dbus_register_interface(conn, "/org/bluez/agent",
-					"org.bluez.Agent1", methods,
+	if (g_dbus_register_interface(conn, AGENT_PATH,
+					AGENT_INTERFACE, methods,
 					NULL, NULL, NULL, NULL) == FALSE) {
 		printf("Failed to register agent object\n");
 		return;
@@ -74,8 +76,8 @@ void agent_unregister(DBusConnection *conn, GDBusProxy *manager)
 		return;
 	}
 
-	if (g_dbus_unregister_interface(conn, "/org/bluez/agent",
-						"org.bluez.Agent1") == FALSE) {
+	if (g_dbus_unregister_interface(conn, AGENT_PATH,
+						AGENT_INTERFACE) == FALSE) {
 		printf("Failed to unregister agent object\n");
 		return;
 	}