From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jarek Czekalski Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r115596: Minor fixes for recent openp changes. Date: Thu, 19 Dec 2013 08:18:24 +0100 Message-ID: <52B29DC0.7030004@poczta.onet.pl> References: <52B21CBB.4050506@poczta.onet.pl> <52B2258B.6040201@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1387437520 27690 80.91.229.3 (19 Dec 2013 07:18:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2013 07:18:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 19 08:18:46 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VtXsY-0003qG-UQ for ged-emacs-devel@m.gmane.org; Thu, 19 Dec 2013 08:18:43 +0100 Original-Received: from localhost ([::1]:42548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtXsY-0004Q9-Cy for ged-emacs-devel@m.gmane.org; Thu, 19 Dec 2013 02:18:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtXsQ-0004P8-VE for emacs-devel@gnu.org; Thu, 19 Dec 2013 02:18:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtXsL-0007bu-CY for emacs-devel@gnu.org; Thu, 19 Dec 2013 02:18:34 -0500 Original-Received: from smtpo15.poczta.onet.pl ([213.180.142.146]:48046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtXsL-0007am-1r for emacs-devel@gnu.org; Thu, 19 Dec 2013 02:18:29 -0500 Original-Received: from [192.168.17.9] (cj.e-siemianowice.pl [95.215.234.30]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jarekczek@poczta.onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3dlPZT4vwKzZCl3l for ; Thu, 19 Dec 2013 08:18:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.onet.pl; s=2011; t=1387437505; bh=oepCFsRr1ZnUVTV6hcFzkCkLLHiB+PhtIsLgGlQFAhQ=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=hwy0zKyl0b7K7VsYARZAdal0bD2hLIOksvCtyWbeF7mcJT8M8fsDS13GpcjDnFaXm Mnro7VzUt8MLhf0YiKVBUjK4avAsVy/EMzAoqh77NXO+ZDZythLmp0zBnoyJET91RC sK8TwXLHqdV++7iDuBDPa4xD04eF/Odz+w2PbFaI= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: <52B2258B.6040201@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.180.142.146 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166608 Archived-At: Paul, Thanks for the explanations and the comment. Some things get cleared. The intent is that we are able to deal with files left on a harddisk from Middle Ages, that's cool :) src/lread.c: /* The last-modified time of the newest matching file found. Initialize it to something less than all valid timestamps. */ struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1); But -1 makes this struct invalid. How can we be sure that comparing an invalid timestamp to a valid timestamp gives us the expected result? src/systime.h: INLINE bool timespec_valid_p (struct timespec t) { return t.tv_nsec >= 0; } So after having this shallow look at timespec structure, I think -1 should be replaced by 0. 999999999, even if more correct, would probably be too pedantic and less readable. Jarek W dniu 2013-12-18 23:45, Paul Eggert pisze: > [...] > Here's a shell transcript to illustrate: > > $ touch -d 0001-12-25 Christmas-1-AD > $ ls -l oldfile > -rw-r--r--. 1 eggert eggert 0 Dec 25 0001 Christmas-1-AD > $ ls -l --time-style=+%s oldfile > -rw-r--r--. 1 eggert eggert 0 -62104665600 Christmas-1-AD > > For this file, file-attributes returns the time stamp > (-947642 512 0 0), and -62104665600 == (-947642 << 16) + 512. > >