Replaces clock_gettime() with ast_tsnow()
authorDavid M. Lee <dlee@respoke.io>
Fri, 24 Jul 2015 22:04:35 +0000 (17:04 -0500)
committerDavid M. Lee <dlee@respoke.io>
Sat, 8 Aug 2015 00:35:13 +0000 (19:35 -0500)
commit40caf0ad9bef07bdfb568a88192c157dd1840100
tree01d1e4f6745b5eeaeb607e5bb85a2884a6ff9087
parent309dd2a4090ccdd1ea31d8d5415a645daddd3883
Replaces clock_gettime() with ast_tsnow()

clock_gettime() is, unfortunately, not portable. But I did like that
over our usual `ts.tv_nsec = tv.tv_usec * 1000` copy/paste code we
usually do when we want a timespec and all we have is ast_tvnow().

This patch adds ast_tsnow(), which mimics ast_tvnow(), but returns a
timespec. If clock_gettime() is available, it will use that. Otherwise
ast_tsnow() falls back to using ast_tvnow().

Change-Id: Ibb1ee67ccf4826b9b76d5a5eb62e90b29b6c456e
configure
configure.ac
include/asterisk/autoconfig.h.in
include/asterisk/time.h
main/Makefile
makeopts.in
tests/test_dns.c
tests/test_dns_query_set.c
tests/test_dns_recurring.c