From 0f9ca6e7b823448832fccfe8297690d68d3e4f83 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 9 May 2014 09:29:39 +0200 Subject: [PATCH] build: adjust to new libsystemd-event API The individual timer-sources were replaced by a unified timer-source. Adjust to that. Signed-off-by: David Herrmann --- src/ctl/sinkctl.c | 13 +++++++------ src/shared/rtsp.c | 26 ++++++++++++++------------ src/shared/wpas.c | 17 +++++++++++------ src/wifi/wifid-supplicant.c | 13 +++++++------ 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/ctl/sinkctl.c b/src/ctl/sinkctl.c index db3fe53..e37fa46 100644 --- a/src/ctl/sinkctl.c +++ b/src/ctl/sinkctl.c @@ -252,12 +252,13 @@ static void schedule_timeout(sd_event_source **out, if (r < 0) cli_vERR(r); } else { - r = sd_event_add_monotonic(cli_event, - out, - rel_usec, - 0, - timeout_fn, - data); + r = sd_event_add_time(cli_event, + out, + CLOCK_MONOTONIC, + rel_usec, + 0, + timeout_fn, + data); if (r < 0) cli_vERR(r); } diff --git a/src/shared/rtsp.c b/src/shared/rtsp.c index 5ea0bd3..818644d 100644 --- a/src/shared/rtsp.c +++ b/src/shared/rtsp.c @@ -2671,12 +2671,13 @@ static int rtsp_link_waiting(struct rtsp_message *m) /* no need to wait for timeout if no-body listens */ if (m->bus->event && m->cb_fn) { - r = sd_event_add_monotonic(m->bus->event, - &m->timer_source, - m->timeout, - 0, - rtsp_timer_fn, - m); + r = sd_event_add_time(m->bus->event, + &m->timer_source, + CLOCK_MONOTONIC, + m->timeout, + 0, + rtsp_timer_fn, + m); if (r < 0) goto error; @@ -3046,12 +3047,13 @@ int rtsp_attach_event(struct rtsp *bus, sd_event *event, int priority) if (!m->cb_fn) continue; - r = sd_event_add_monotonic(bus->event, - &m->timer_source, - m->timeout, - 0, - rtsp_timer_fn, - m); + r = sd_event_add_time(bus->event, + &m->timer_source, + CLOCK_MONOTONIC, + m->timeout, + 0, + rtsp_timer_fn, + m); if (r < 0) goto error; diff --git a/src/shared/wpas.c b/src/shared/wpas.c index 3edaaf1..9e003d5 100644 --- a/src/shared/wpas.c +++ b/src/shared/wpas.c @@ -1565,12 +1565,17 @@ int wpas_attach_event(struct wpas *w, sd_event *event, int priority) if (r < 0) goto error; - r = sd_event_add_monotonic(w->event, - &w->timer_source, - 0, - 0, - wpas_timer_fn, - w); + r = sd_event_add_time(w->event, + &w->timer_source, + CLOCK_MONOTONIC, + 0, + 0, + wpas_timer_fn, + w); + if (r < 0) + goto error; + + r = sd_event_source_set_enabled(w->timer_source, SD_EVENT_OFF); if (r < 0) goto error; diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c index 898abf1..7d4d6f9 100644 --- a/src/wifi/wifid-supplicant.c +++ b/src/wifi/wifid-supplicant.c @@ -2478,12 +2478,13 @@ int supplicant_start(struct supplicant *s) goto error; /* add initial 200ms startup timer */ - r = sd_event_add_monotonic(s->l->m->event, - &s->timer_source, - shl_now(CLOCK_MONOTONIC) + 200 * 1000ULL, - 0, - supplicant_timer_fn, - s); + r = sd_event_add_time(s->l->m->event, + &s->timer_source, + CLOCK_MONOTONIC, + shl_now(CLOCK_MONOTONIC) + 200 * 1000ULL, + 0, + supplicant_timer_fn, + s); if (r < 0) { log_vERR(r); goto error;