summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am4
-rw-r--r--src/lib/agent-helper.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 60e224d..cd7d261 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
AM_CPPFLAGS = $(GLIB_CFLAGS) $(GIO_CFLAGS)
-AM_LDFLAGS = $(GLIB_LIBS) $(GIO_LIBS)
+LDADD = $(GLIB_LIBS) $(GIO_LIBS)
bluez_sources = lib/bluez/adapter.c lib/bluez/adapter.h \
lib/bluez/agent_manager.c lib/bluez/agent_manager.h \
@@ -50,6 +50,6 @@ bt_agent_SOURCES = $(lib_sources) $(bluez_sources) bt-agent.c
bt_device_SOURCES = $(lib_sources) $(bluez_sources) bt-device.c
bt_network_SOURCES = $(lib_sources) $(bluez_sources) bt-network.c
bt_obex_SOURCES = $(lib_sources) $(bluez_sources) bt-obex.c
-bt_obex_LDADD = $(LIBREADLINE)
+bt_obex_LDADD = $(LDADD) $(LIBREADLINE)
dist_man_MANS = bt-adapter.1 bt-agent.1 bt-device.1 bt-network.1 bt-obex.1
diff --git a/src/lib/agent-helper.c b/src/lib/agent-helper.c
index 5269005..740a8ed 100644
--- a/src/lib/agent-helper.c
+++ b/src/lib/agent-helper.c
@@ -279,7 +279,7 @@ static void _bt_agent_method_call_func(GDBusConnection *connection, const gchar
GError *error = NULL;
Device *device_obj = device_new(g_variant_get_string(g_variant_get_child_value(parameters, 0), NULL));
const gchar *pin = _find_device_pin(device_get_dbus_object_path(device_obj));
- const gchar *ret = NULL;
+ const gchar ret[16];
if (_interactive)
g_print("Device: %s (%s)\n", device_get_alias(device_obj, &error), device_get_address(device_obj, &error));
@@ -307,7 +307,9 @@ static void _bt_agent_method_call_func(GDBusConnection *connection, const gchar
errno = 0;
if (scanf("%s", &ret) == EOF && errno)
g_warning("%s\n", strerror(errno));
- g_dbus_method_invocation_return_value(invocation, g_variant_new_string(ret));
+ GVariant* vars[1];
+ vars[0] = g_variant_new_string(ret);
+ g_dbus_method_invocation_return_value(invocation, g_variant_new_tuple(vars, 1));
return;
}