diff options
| -rw-r--r-- | input/input-service.c | 14 | 
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;  }  | 
