assert(client);
- r = sd_event_get_now_monotonic(client->event, &time_now);
+ r = sd_event_now(client->event, CLOCK_MONOTONIC, &time_now);
if (r < 0)
return r;
assert(time_now >= client->start_time);
assert(client);
assert(client->event);
- r = sd_event_get_now_monotonic(client->event, &time_now);
+ r = sd_event_now(client->event, CLOCK_MONOTONIC, &time_now);
if (r < 0)
goto error;
client->timeout_resend = sd_event_source_unref(client->timeout_resend);
- r = sd_event_add_monotonic(client->event,
- &client->timeout_resend,
- next_timeout,
- 10 * USEC_PER_MSEC,
- client_timeout_resend, client);
+ r = sd_event_add_time(client->event,
+ &client->timeout_resend,
+ CLOCK_MONOTONIC,
+ next_timeout, 10 * USEC_PER_MSEC,
+ client_timeout_resend, client);
if (r < 0)
goto error;
client->timeout_resend = sd_event_source_unref(client->timeout_resend);
- r = sd_event_add_monotonic(client->event,
- &client->timeout_resend, 0, 0,
- client_timeout_resend, client);
+ r = sd_event_add_time(client->event,
+ &client->timeout_resend,
+ CLOCK_MONOTONIC,
+ 0, 0,
+ client_timeout_resend, client);
if (r < 0)
goto error;
if (client->lease->lifetime == 0xffffffff)
return 0;
- r = sd_event_get_now_monotonic(client->event, &time_now);
+ r = sd_event_now(client->event, CLOCK_MONOTONIC, &time_now);
if (r < 0)
return r;
assert(client->request_sent <= time_now);
}
/* arm lifetime timeout */
- r = sd_event_add_monotonic(client->event,
- &client->timeout_expire, lifetime_timeout,
- 10 * USEC_PER_MSEC,
- client_timeout_expire, client);
+ r = sd_event_add_time(client->event, &client->timeout_expire,
+ CLOCK_MONOTONIC,
+ lifetime_timeout, 10 * USEC_PER_MSEC,
+ client_timeout_expire, client);
if (r < 0)
return r;
return 0;
/* arm T2 timeout */
- r = sd_event_add_monotonic(client->event,
- &client->timeout_t2,
- t2_timeout,
- 10 * USEC_PER_MSEC,
- client_timeout_t2, client);
+ r = sd_event_add_time(client->event,
+ &client->timeout_t2,
+ CLOCK_MONOTONIC,
+ t2_timeout,
+ 10 * USEC_PER_MSEC,
+ client_timeout_t2, client);
if (r < 0)
return r;
return 0;
/* arm T1 timeout */
- r = sd_event_add_monotonic(client->event,
- &client->timeout_t1,
- t1_timeout,
- 10 * USEC_PER_MSEC,
- client_timeout_t1, client);
+ r = sd_event_add_time(client->event,
+ &client->timeout_t1,
+ CLOCK_MONOTONIC,
+ t1_timeout, 10 * USEC_PER_MSEC,
+ client_timeout_t1, client);
if (r < 0)
return r;
client->state = DHCP_STATE_REQUESTING;
client->attempt = 1;
- r = sd_event_add_monotonic(client->event,
- &client->timeout_resend, 0,
- 0, client_timeout_resend,
- client);
+ r = sd_event_add_time(client->event,
+ &client->timeout_resend,
+ CLOCK_MONOTONIC,
+ 0, 0,
+ client_timeout_resend, client);
if (r < 0)
goto error;