[prev in list] [next in list] [prev in thread] [next in thread]
List: ooh323c-devel
Subject: Re: [ooh323c-devel] Core dump with asterisk 1.2.0-beta1
From: Ben Greear <greearb () candelatech ! com>
Date: 2005-10-12 20:52:31
Message-ID: 434D778F.3080109 () candelatech ! com
[Download RAW message or body]
Ben Greear wrote:
> I get this core trace when starting up asterisk. I've done
> the install per directions..though maybe I still have a configuration
> problem somewhere...
This patch fixes the problem. This crash may be due to the fact
that I'm running on an x86-64 system.. The old code played fast
and loose with assuming size of time_t, etc.
[greear@grok asterisk-ooh323c]$ diff -u \
~/asterisk-addons-1.2.0-beta1/asterisk-ooh323c/ooh323c/src/ootrace.c \
ooh323c/src/ootrace.c
--- /home/greear/asterisk-addons-1.2.0-beta1/asterisk-ooh323c/ooh323c/src/ootrace.c \
2005-06-16 12:41:23.000000000 -0700
+++ ooh323c/src/ootrace.c 2005-10-12 13:47:51.000000000 -0700
@@ -17,6 +17,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
+#include <time.h>
#include "ootypes.h"
#include "ootrace.h"
@@ -275,10 +276,9 @@
#else
struct tm *ptime;
- struct timeval systemTime;
char dateString[10];
- gettimeofday(&systemTime, NULL);
- ptime = (struct tm*)localtime(&systemTime.tv_sec);
+ time_t t = time(NULL);
+ ptime = localtime(&t);
strftime(timeString, 100, "%H:%M:%S", ptime);
strftime(currtime, 3, "%H", ptime);
if(lasttime>atoi(currtime))
@@ -309,9 +309,12 @@
fprintf(gH323ep.fptraceFile, "---------Date %s---------\n",
dateString);
}
- if(printTime)
+ if(printTime) {
+ struct timeval systemTime;
+ gettimeofday(&systemTime, NULL);
fprintf(gH323ep.fptraceFile, "%s:%03d %s", timeString,
systemTime.tv_usec/1000, logMessage);
+ }
else
fprintf(gH323ep.fptraceFile, "%s", logMessage);
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
ooh323c-devel mailing list
ooh323c-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ooh323c-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic