aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-24 03:36:01 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-24 03:36:01 +0000
commita9697cb0f74cb1f50e4497bb70bf49357f0c425d (patch)
treebf26d3bf33b276ee1626c2a888e0d32e0d0c3d46 /main
parentfcca2ea91a02e58717221a94f46085fa2405d7c2 (diff)
Merged revisions 288636 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r288636 | tilghman | 2010-09-23 22:20:24 -0500 (Thu, 23 Sep 2010) | 2 lines Solaris compatibility fixes ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@288637 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/strcompat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/strcompat.c b/main/strcompat.c
index a3f0e1497..efd85c3bb 100644
--- a/main/strcompat.c
+++ b/main/strcompat.c
@@ -163,6 +163,19 @@ int vasprintf(char **strp, const char *fmt, va_list ap)
}
#endif /* !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC) */
+#ifndef HAVE_TIMERSUB
+void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
+{
+ tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
+ tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
+ if (tvdiff->tv_usec < 0) {
+ tvdiff->tv_sec --;
+ tvdiff->tv_usec += 1000000;
+ }
+
+}
+#endif
+
/*
* Based on Code from bsd-asprintf from OpenSSH
* Copyright (c) 2004 Darren Tucker.