[Nagiosplug-devel] [ nagiosplug-Patches-1185713 ] PATCH: check_time for 64bit long systems

SourceForge.net noreply at sourceforge.net
Tue Apr 19 00:51:21 CEST 2005


Patches item #1185713, was opened at 2005-04-19 17:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1185713&group_id=29880

Category: Bugfix
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Bray (illumino)
Assigned to: Nobody/Anonymous (nobody)
Summary: PATCH: check_time for 64bit long systems 

Initial Comment:

check_time provides an incorrect result on systems
using 64bit longs (such as Solaris 9 / SPARCv9 /
gcc-sparcv9-3.4.3) as the data returned off the network
socket read, is placed in the upper half of the 64bit
unsigned long and not the lower half. The function in
question ntohl on Solaris takes a uint32_t not a long,
changing the type of the variables used fixed the problem.

I have not verified that the type "uint32_t" is
available of all systems (eg Linux, OSX, *BSD, ...) but
the use of unsigned long is incorrect (I believe) is it
is variable by platform & compiler.

The following is a summary of the attached patch:
OLD:  unsigned long  server_time, raw_server_time;
NEW: uint32_t          server_time, raw_server_time;

Regards,
Peter Bray
Sydney, Australia

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1185713&group_id=29880




More information about the Devel mailing list