[Asterisk-Dev] Re: ast_localtime() weird interface.

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Oct 12 09:44:50 MST 2005


On Wednesday 12 October 2005 09:42, Luigi Rizzo wrote:
> On Wed, Oct 12, 2005 at 09:15:53AM -0500, Tilghman Lesher wrote:
> > On Wednesday 12 October 2005 03:17, Luigi Rizzo wrote:
>
> ...
>
> > > > What kind of problems are you encountering in dealing with the
> > > > different definitions of time_t?
> > >
> > > the problem is that depending on the platform, time_t is
> > > some variant of integer types, and a zillion places in say.c
> > > calls ast_localtime() using &foo.tv_sec as a first argument
> > > where foo is of type struct timeval.
> > >
> > > The two types happen to differ on FreeBSD-6, as may be the case
> > > on many other OS where system headers try to adapt to 64-bit
> > > values for some types but one reason or another struct timeval
> > > and time_t are not in sync.
> >
> > That sounds like a call for you to fix FreeBSD.
>
> that sounds like you are missing the point :)

The point being that FreeBSD is broken?

> "fixing" freebsd won't help with the other 34 operating system
> variants where we would hope to run asterisk.

Let me get this straight.  FreeBSD is currently broken; therefore you
postulate that 34 other operating systems will also be broken.  So
instead of fixing the problem EVERYWHERE, you want to break
all other operating systems?

> The point is, if we use different types (such as time_t and struct
> timeval's tv_sec), then we cannot complain because they _really_ are
> different on a given platform.

On my given platform, they're the same size.  Why is it that a broken
platform should trump a sane platform?  Why not fix the brokenness
and let it be sane once again, everywhere?

-- 
Tilghman



More information about the asterisk-dev mailing list