[Pdns-dev] Pdns-dev Digest, Vol 121, Issue 4

Juergen Ilse powerdns at usenet-verwaltung.de
Wed Feb 19 12:28:34 CET 2014


Hallo,

On Wed, Feb 19, 2014 at 12:00:01PM +0100, pdns-dev-request at mailman.powerdns.com wrote:
> ----------------------------------------------------------------------
> Message: 1
> Date: Wed, 19 Feb 2014 04:55:18 +0100
> From: a b <tripivceta at hotmail.com>
> To: "pdns-dev at mailman.powerdns.com" <pdns-dev at mailman.powerdns.com>
> Subject: [Pdns-dev] pdns/dnspacket.cc patch
> Message-ID: <DUB119-W16654A605BD58041851CA1DC9B0 at phx.gbl>
> 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 ...



More information about the Pdns-dev mailing list