Hi Elena,

On 05/15/2012 03:37 PM, Elena Tebesoi wrote:
Hi Jukka,

Thank you for the quick review and please find my answers inline.
A new version of the patch is due, taking into account your suggestions.

Regards,
Elena

On Mon, May 14, 2012 at 2:21 PM, Jukka Rissanen
<[email protected] <mailto:[email protected]>>


        connman_resolver_append___lifetime(const char *interface, const
        char *domain,
                                return 0;
                        }

        -               entry->timeout = g_timeout_add_seconds(__lifetime,
        -
        resolver_expire_cb, entry);
        +               interval = floor(lifetime *
        +
        RESOLVER_LIFETIME_REFRESH___THRESHOLD);


    Do we really need to use floor() here? What about just

            interval = lifetime * RESOLVER_LIFETIME_REFRESH___THRESHOLD;

    The lifetime > 0 so we cannot have negative interval anyway.


[ElenaT] What I tried with floor and ceil is to split the lifetime into
two intervals without losing additional 1second with conversion from
floating point to integer.
RESOLVER_LIFETIME_REFRESH_THRESHOLD is floating point here.


Yes, I know. In this case you do not need to call floor() because interval is integer, the result of lifetime * RESOLVER_..._THRESHOLD will do the floor automagically for you (the value is truncated).


Cheers,
Jukka

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to