nicer gettimeofday error handling.

git-svn-id: file:///svn/unbound/trunk@4071 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2017-03-20 15:35:00 +00:00
parent 29ac62d7b0
commit fadd01e93e

View File

@ -139,9 +139,10 @@ dnscrypt_hrtime(void)
int ret;
ret = gettimeofday(&tv, NULL);
assert(ret == 0);
if (ret == 0) {
ts = (uint64_t)tv.tv_sec * 1000000U + (uint64_t)tv.tv_usec;
} else {
log_err("gettimeofday: %s", strerror(errno));
}
return ts;
}