summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile.am4
-rw-r--r--src/bt-device.c1
-rw-r--r--src/lib/agent-helper.c6
4 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index a772cb1..6211624 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,7 @@ AC_HEADER_STDC
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24.0])
-PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0])
+PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0 gio-unix-2.0 >= 2.26.0])
# Check for the availability of libreadline
AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
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/bt-device.c b/src/bt-device.c
index 3472331..2b16432 100644
--- a/src/bt-device.c
+++ b/src/bt-device.c
@@ -32,6 +32,7 @@
#include <glib.h>
#include <gio/gio.h>
+#include <gio/gunixinputstream.h>
#include "lib/dbus-common.h"
#include "lib/helpers.h"
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;
}