diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-24 03:39:29 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-24 03:39:29 +0000 |
commit | 870b7e572dab611717acf7d2b0150cbb549c1b78 (patch) | |
tree | d92db233d0dd6f17d20abe74ac8e80eddfcb6339 /main | |
parent | cfb6e8df353ffd5f438c28c63152924aead62e89 (diff) |
Merged revisions 288637 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
................
r288637 | tilghman | 2010-09-23 22:36:01 -0500 (Thu, 23 Sep 2010) | 9 lines
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.8@288638 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/strcompat.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/main/strcompat.c b/main/strcompat.c index 923e935f7..831ab0ce9 100644 --- a/main/strcompat.c +++ b/main/strcompat.c @@ -169,6 +169,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. |