From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14388 invoked by alias); 4 Mar 2002 15:57:17 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 14333 invoked from network); 4 Mar 2002 15:57:14 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 4 Mar 2002 15:57:14 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 854D21E53B; Mon, 4 Mar 2002 16:57:13 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Jakub Jelinek Cc: Ulrich Drepper , Glibc hackers Subject: Re: [PATCH] Fix ftime References: <20020304164541.Q2204@sunsite.ms.mff.cuni.cz> X-Yow: I'm meditating on the FORMALDEHYDE and the ASBESTOS leaking into my PERSONAL SPACE!! From: Andreas Schwab Date: Mon, 04 Mar 2002 07:57:00 -0000 In-Reply-To: <20020304164541.Q2204@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Mon, 4 Mar 2002 16:45:41 +0100") Message-ID: User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (ia64-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-03/txt/msg00023.txt.bz2 Jakub Jelinek writes: |> Hi! |> |> I couldn't find anything which would mandate this, but at least it is very |> weird to have millitm = 1000 returned (in 0.0999% of cases) when it is supposed |> to mean millisecond part of the time. |> |> 2002-03-04 Jakub Jelinek |> |> * sysdeps/unix/bsd/ftime.c (ftime): Don't return 1000 in millitm. |> |> --- libc/sysdeps/unix/bsd/ftime.c.jj Thu Aug 23 18:50:29 2001 |> +++ libc/sysdeps/unix/bsd/ftime.c Mon Mar 4 16:47:20 2002 |> @@ -1,4 +1,4 @@ |> -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. |> +/* Copyright (C) 1994, 1997, 2002 Free Software Foundation, Inc. |> This file is part of the GNU C Library. |> |> The GNU C Library is free software; you can redistribute it and/or |> @@ -33,5 +33,10 @@ ftime (timebuf) |> timebuf->millitm = (tv.tv_usec + 999) / 1000; Perhaps we should actually truncate here instead of rounding up. |> timebuf->timezone = tz.tz_minuteswest; |> timebuf->dstflag = tz.tz_dsttime; |> + if (timebuf->millitm == 1000) |> + { |> + timebuf->time++; |> + timebuf->millitm = 0; |> + } |> return 0; |> } Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."