ACK: [PATCH] Fix g_timeout_add to wait an integer number of seconds

Alex Hung alex.hung at canonical.com
Fri Nov 28 09:32:03 UTC 2014


On 14-11-27 07:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The time argument was original 0.1 seconds, however this needs
> to be an integer value, and this is rounded down to 0 seconds
> which is not correct.  Instead, use 1 seconds as this is the
> lowest integer timeout possible.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/lib/src/fwts_pm_method.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_pm_method.c b/src/lib/src/fwts_pm_method.c
> index 00f870b..c246fb7 100644
> --- a/src/lib/src/fwts_pm_method.c
> +++ b/src/lib/src/fwts_pm_method.c
> @@ -318,7 +318,7 @@ int fwts_logind_wait_for_resume_from_action(
>   	/* Start the main loop */
>   	fwts_settings->gmainloop = g_main_loop_new(NULL, FALSE);
>   	if (fwts_settings->gmainloop) {
> -		g_timeout_add(0.1, logind_do, fwts_settings);
> +		g_timeout_add(1, logind_do, fwts_settings);
>   
>   		g_main_loop_run(fwts_settings->gmainloop);
>   		duration = (int)(fwts_settings->t_end - fwts_settings->t_start);

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list