summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-05-09 09:29:39 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-05-09 09:29:39 +0200
commit0f9ca6e7b823448832fccfe8297690d68d3e4f83 (patch)
tree27da87a8b78966cf93ac49c9734c7c61a1e82b7e
parent37c2169c9e060f193fbf8eb201f28b67a67b8985 (diff)
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 <dh.herrmann@gmail.com>
-rw-r--r--src/ctl/sinkctl.c13
-rw-r--r--src/shared/rtsp.c26
-rw-r--r--src/shared/wpas.c17
-rw-r--r--src/wifi/wifid-supplicant.c13
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;