diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-03-24 02:49:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-03-24 02:58:41 +0100 |
commit | 6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b (patch) | |
tree | 37083cf4a7292fc4657372d034475e026693f969 /src/libsystemd-network/sd-ipv4ll.c | |
parent | f66eeb6bb636f8061bf45e6e8e24761e87510800 (diff) |
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too
Diffstat (limited to 'src/libsystemd-network/sd-ipv4ll.c')
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 7431af729e..a201139b08 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -165,7 +165,7 @@ static int ipv4ll_timer(sd_event_source *s, uint64_t usec, void *userdata) { return 0; } -static void ipv4ll_set_next_wakeup (sd_ipv4ll *ll, int sec, int random_sec) { +static void ipv4ll_set_next_wakeup(sd_ipv4ll *ll, int sec, int random_sec) { usec_t next_timeout = 0; usec_t time_now = 0; @@ -178,7 +178,7 @@ static void ipv4ll_set_next_wakeup (sd_ipv4ll *ll, int sec, int random_sec) { if (random_sec) next_timeout += random_u32() % (random_sec * USEC_PER_SEC); - if (sd_event_get_now_monotonic(ll->event, &time_now) < 0) + if (sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now) < 0) time_now = now(CLOCK_MONOTONIC); ll->next_wakeup = time_now + next_timeout; @@ -278,7 +278,7 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (ipv4ll_arp_conflict(ll, in_packet)) { - r = sd_event_get_now_monotonic(ll->event, &time_now); + r = sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now); if (r < 0) goto out; @@ -330,8 +330,8 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (ll->next_wakeup_valid) { ll->timer = sd_event_source_unref(ll->timer); - r = sd_event_add_monotonic(ll->event, &ll->timer, - ll->next_wakeup, 0, ipv4ll_timer, ll); + r = sd_event_add_time(ll->event, &ll->timer, CLOCK_MONOTONIC, + ll->next_wakeup, 0, ipv4ll_timer, ll); if (r < 0) goto out; @@ -530,8 +530,11 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) { if (r < 0) goto out; - r = sd_event_add_monotonic(ll->event, &ll->timer, now(CLOCK_MONOTONIC), 0, - ipv4ll_timer, ll); + r = sd_event_add_time(ll->event, + &ll->timer, + CLOCK_MONOTONIC, + now(CLOCK_MONOTONIC), 0, + ipv4ll_timer, ll); if (r < 0) goto out; |