From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 6 18:50:02 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D1451065670 for ; Tue, 6 Jul 2010 18:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E68B78FC1A for ; Tue, 6 Jul 2010 18:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o66Io0Ww012778 for ; Tue, 6 Jul 2010 18:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o66Io0oY012777; Tue, 6 Jul 2010 18:50:00 GMT (envelope-from gnats) Resent-Date: Tue, 6 Jul 2010 18:50:00 GMT Resent-Message-Id: <201007061850.o66Io0oY012777@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mayo Jordanov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C7F106567B for ; Tue, 6 Jul 2010 18:43:44 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 693558FC1A for ; Tue, 6 Jul 2010 18:43:44 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o66Ihh1V056165 for ; Tue, 6 Jul 2010 18:43:43 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o66Ihhmq056164; Tue, 6 Jul 2010 18:43:43 GMT (envelope-from nobody) Message-Id: <201007061843.o66Ihhmq056164@www.freebsd.org> Date: Tue, 6 Jul 2010 18:43:43 GMT From: Mayo Jordanov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/148407: time handling error in patch X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:50:02 -0000 >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: