Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2010 18:43:43 GMT
From:      Mayo Jordanov <mayo@oyam.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/148407: time handling error in patch
Message-ID:  <201007061843.o66Ihhmq056164@www.freebsd.org>
Resent-Message-ID: <201007061850.o66Io0oY012777@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         148407
>Category:       ports
>Synopsis:       time handling error in patch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 06 18:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Mayo Jordanov
>Release:        8.0-RELEASE-p1
>Organization:
>Environment:
FreeBSD test 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #0: Mon Dec 28 01:59:23 PST 2009     mayo@test.:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The commonlib.c patch in the port changes the struct used to get time of day, but does not take into account change between miliseconds and microseconds. If you notice, the original patch adds seconds to miliseconds, rather than seconds to seconds. The attached below fixes that.
>How-To-Repeat:
Run the demo, the times reported to solve the problem are out of whack.
>Fix:
See the attached patch.

Patch attached with submission follows:

--- files/patch-shared+commonlib.c.orig	2010-07-06 11:29:44.000000000 -0700
+++ files/patch-shared+commonlib.c	2010-07-06 11:31:12.000000000 -0700
@@ -18,7 +18,7 @@
 +  struct timezone tz;
 +
 +  gettimeofday(&tv, &tz);
-+  return((double)tv.tv_sec+((double)tv.tv_usec)/1000.0);
++  return((double)tv.tv_sec+((double)tv.tv_usec)/1000000.0);
  
 -  ftime(&buf);
 -  return((double)buf.time+((double) buf.millitm)/1000.0);


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007061843.o66Ihhmq056164>