summaryrefslogtreecommitdiffstats
path: root/input/input-service.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-11-13 11:51:55 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-11-13 11:51:55 +0000
commit8512236a405d345e4a9c19d47e593cbf2fec81e3 (patch)
tree9aed9919da0700203cfec2070f5b2bb5e739f16b /input/input-service.c
parent40e3342c520a00d47d68f7791cb70cb49d698630 (diff)
code cleanup/fixes
Diffstat (limited to 'input/input-service.c')
-rw-r--r--input/input-service.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/input/input-service.c b/input/input-service.c
index 14bce1c3..15e37e44 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -34,6 +34,8 @@
#define INPUT_PATH "/org/bluez/input"
+static int started = 0;
+
static DBusConnection *connection = NULL;
static DBusHandlerResult start_message(DBusConnection *conn,
@@ -41,18 +43,20 @@ static DBusHandlerResult start_message(DBusConnection *conn,
{
DBusMessage *reply;
- info("Starting example service");
+ info("Starting input service");
reply = dbus_message_new_method_return(msg);
if (!reply) {
error("Can't create reply message");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
dbus_connection_send(conn, reply, NULL);
dbus_message_unref(reply);
+ started = 1;
+
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -61,7 +65,7 @@ static DBusHandlerResult stop_message(DBusConnection *conn,
{
DBusMessage *reply;
- info("Stopping example service");
+ info("Stopping input service");
reply = dbus_message_new_method_return(msg);
if (!reply) {
@@ -73,6 +77,8 @@ static DBusHandlerResult stop_message(DBusConnection *conn,
dbus_message_unref(reply);
+ started = 0;
+
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -167,6 +173,8 @@ int input_dbus_init(void)
return -1;
}
+ dbus_message_unref(reply);
+
return 0;
}