From 3882669d3e20bcbca991e6775d0d05401d58a1b6 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 23 Nov 2006 05:27:15 +0000 Subject: [PATCH] transaction id fixes from richard nyberg; return correct error code when file for resolv.conf cannot be found. svn:r276 --- evdns.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/evdns.c b/evdns.c index 1ddad821..085ffa62 100644 --- a/evdns.c +++ b/evdns.c @@ -798,15 +798,17 @@ transaction_id_pick(void) { const struct request *req = req_head, *started_at; #ifdef DNS_USE_CPU_CLOCK_FOR_ID struct timespec ts; - const u16 trans_id = ts.tv_nsec & 0xffff; + u16 trans_id; if (clock_gettime(CLOCK_MONOTONIC, &ts)) event_err(1, "clock_gettime"); + trans_id = ts.tv_nsec & 0xffff; #endif #ifdef DNS_USE_GETTIMEOFDAY_FOR_ID struct timeval tv; - const u16 trans_id = tv.tv_usec & 0xffff; + u16 trans_id; gettimeofday(&tv, NULL); + trans_id = tv.tv_usec & 0xffff; #endif #ifdef DNS_USE_OPENSSL_FOR_ID @@ -1807,7 +1809,7 @@ evdns_resolv_conf_parse(int flags, const char *const filename) { fd = open(filename, O_RDONLY); if (fd < 0) { evdns_resolv_set_defaults(flags); - return 0; + return 1; } if (fstat(fd, &st)) { err = 2; goto out1; } -- 2.40.0