pkgsrc-ng/comms/asterisk/patches/patch-main_utils.c
2013-09-26 17:14:40 +02:00

32 lines
1.1 KiB
C

$NetBSD: patch-main_utils.c,v 1.1 2012/12/11 08:22:49 jnemeth Exp $
--- main/utils.c.orig 2012-08-27 14:07:12.000000000 +0000
+++ main/utils.c
@@ -500,7 +500,7 @@ const char *ast_inet_ntoa(struct in_addr
static int dev_urandom_fd;
#endif
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__DragonFly__)
#undef pthread_create /* For ast_pthread_create function only */
#endif /* !__linux__ */
@@ -1431,13 +1431,13 @@ int ast_false(const char *s)
static struct timeval tvfix(struct timeval a)
{
if (a.tv_usec >= ONE_MILLION) {
- ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
- (long)a.tv_sec, (long int) a.tv_usec);
+ ast_log(LOG_WARNING, "warning too large timestamp %jd.%ld\n",
+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
a.tv_sec += a.tv_usec / ONE_MILLION;
a.tv_usec %= ONE_MILLION;
} else if (a.tv_usec < 0) {
- ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
- (long)a.tv_sec, (long int) a.tv_usec);
+ ast_log(LOG_WARNING, "warning negative timestamp %jd.%ld\n",
+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
a.tv_usec = 0;
}
return a;