2014-04-04 23:02:01

by Petri Gynther

[permalink] [raw]
Subject: [PATCH 1/2] input: Fix input.conf IdleTimeout handling

IdleTimeout is an optional config item in input.conf. Don't complain
if it is not defined. Instead, do the opposite and show its value in
debug logs only when it is defined.
---
profiles/input/manager.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/profiles/input/manager.c b/profiles/input/manager.c
index 6ef83f4..23e739a 100644
--- a/profiles/input/manager.c
+++ b/profiles/input/manager.c
@@ -99,13 +99,12 @@ static int input_init(void)
int idle_timeout;

idle_timeout = g_key_file_get_integer(config, "General",
- "IdleTimeout", &err);
- if (err) {
- DBG("input.conf: %s", err->message);
- g_error_free(err);
- }
-
- input_set_idle_timeout(idle_timeout * 60);
+ "IdleTimeout", &err);
+ if (!err) {
+ DBG("input.conf: IdleTimeout=%d", idle_timeout);
+ input_set_idle_timeout(idle_timeout * 60);
+ } else
+ g_clear_error(&err);
}

btd_profile_register(&input_profile);
--
1.9.1.423.g4596e3a



2014-04-08 00:38:57

by Petri Gynther

[permalink] [raw]
Subject: Re: [PATCH 1/2] input: Fix input.conf IdleTimeout handling

Hi Johan,

On Fri, Apr 4, 2014 at 11:50 PM, Johan Hedberg <[email protected]> wrote:
> Hi Petri,
>
> On Fri, Apr 04, 2014, Petri Gynther wrote:
>> IdleTimeout is an optional config item in input.conf. Don't complain
>> if it is not defined. Instead, do the opposite and show its value in
>> debug logs only when it is defined.
>> ---
>> profiles/input/manager.c | 13 ++++++-------
>> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> Both patches have been applied. I also applied an extra patch to make
> the is_connected functions use bool instead of int.

Thanks for applying these patches. Next, I will send out the revised
"uHIDP: HIDP in userspace" patch, which will address your code review
comments from March 17.

-- Petri

>
> Johan

2014-04-05 06:50:17

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 1/2] input: Fix input.conf IdleTimeout handling

Hi Petri,

On Fri, Apr 04, 2014, Petri Gynther wrote:
> IdleTimeout is an optional config item in input.conf. Don't complain
> if it is not defined. Instead, do the opposite and show its value in
> debug logs only when it is defined.
> ---
> profiles/input/manager.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)

Both patches have been applied. I also applied an extra patch to make
the is_connected functions use bool instead of int.

Johan