summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-03 17:57:26 +0200
committerTom Gundersen <teg@jklm.no>2015-08-03 17:57:26 +0200
commit6934f402cded89a988e8d7f93bf0b7b4eb8f17f3 (patch)
tree0decd0bdddc5a9be1ea76ce38c756ec85e42ab94 /src/resolve
parent5ef9b2203e027da168b18d92045462422895565b (diff)
parent38a03f06a7393d2721c23f23f0589d2f6d0904af (diff)
Merge pull request #843 from poettering/clock-boottime
sd-event: make sure sd_event_now() cannot fail
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-transaction.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index 487b2c5162..53779f3372 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -372,9 +372,7 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) {
}
}
- r = sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts);
- if (r < 0)
- ts = now(clock_boottime_or_monotonic());
+ assert_se(sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts) >= 0);
switch (t->scope->protocol) {
case DNS_PROTOCOL_DNS:
@@ -602,9 +600,7 @@ int dns_transaction_go(DnsTransaction *t) {
return 0;
}
- r = sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts);
- if (r < 0)
- ts = now(clock_boottime_or_monotonic());
+ assert_se(sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts) >= 0);
t->n_attempts++;
t->start_usec = ts;