Re: Pdns-dev Digest, Vol 121, Issue 4

Juergen Ilse <[email protected]>
Newsgroups gmane.network.dns.powerdns.devel
Message-ID <[email protected]>
Hallo,

On Wed, Feb 19, 2014 at 12:00:01PM +0100, [email protected] wrote:
> ----------------------------------------------------------------------
> Message: 1
> Date: Wed, 19 Feb 2014 04:55:18 +0100
> From: a b <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: [Pdns-dev] pdns/dnspacket.cc patch
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> This patch fixes the compile error reported earlier with GCC 4.7.1. If
> someone with more insight could review it and provide feedback, it wouldi
> be much appreciated. In the patch I replaced uint64_t with long because
> that is labs(3C) calls for in the prototype. However, I am not sure that
> this is correct. Presumably, with uint64_t the intent was much finer time
> granularity?

I think both variants (the original as well as your "correction") are not
really correct. According to the man-page for the libraryfunction time()
returns something from type time_t, so the variable to which this return-
value is assigned, should have type time_t. And if you want to build the
difference from 2 time-stamps returned by different calls to time(), you
should use the function difftime, which returns the difference in seconds
as a double value. I think, all other possibilities would be system-dependent
and *not* really portable.

regards,
	Juergen Ilse
-- 
Ein Domainname (auch wenn er Teil einer Mailadresse ist) ist nur ein Name,
nicht mehr und nicht weniger ...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.