From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: init_buffer PWD fix Date: Mon, 22 Apr 2002 00:22:05 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200204220722.g3M7M5D23857@sic.twinsun.com> References: NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1019460260 22929 127.0.0.1 (22 Apr 2002 07:24:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 22 Apr 2002 07:24:20 +0000 (UTC) Cc: knagano@sodan.org, emacs-devel@gnu.org, andrewi@gnu.org, jasonr@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zYBP-0005xi-00 for ; Mon, 22 Apr 2002 09:24:19 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zYC0-0005YN-00 for ; Mon, 22 Apr 2002 09:24:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zYBH-0002CS-00; Mon, 22 Apr 2002 03:24:11 -0400 Original-Received: from alcor.twinsun.com ([198.147.65.9]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zY9H-000241-00; Mon, 22 Apr 2002 03:22:07 -0400 Original-Received: from sic.twinsun.com ([192.54.239.17]) by alcor.twinsun.com (8.12.1/8.12.1) with ESMTP id g3M7M5Pd004955; Mon, 22 Apr 2002 00:22:05 -0700 (PDT) Original-Received: (eggert@localhost) by sic.twinsun.com (8.11.6+Sun/8.11.6) id g3M7M5D23857; Mon, 22 Apr 2002 00:22:05 -0700 (PDT) Original-To: eliz@is.elta.co.il In-Reply-To: (eliz@is.elta.co.il) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2987 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2987 > Date: Mon, 22 Apr 2002 11:10:55 +0300 (IDT) > From: Eli Zaretskii > > > any workaround should apply only to Windows > > platforms where 'stat' is broken. Fcopy_file uses the conditional > > `#if !defined (DOS_NT) || __DJGPP__ > 1' before inspecting st_ino; > > would that be appropriate here too? > > DJGPP emulates the inodes well enough for the code to work, but the > Windows port is not compiled with DJGPP. Hmm, I guess nobody told the author of Fcopy_file.... Perhaps there's an opportunity for code consolidation/cleanup there. Anyway, rather than get sucked into st_ino portability hell, how about checking st_mtime as well? That is, after doing this: && stat (pwd, &pwdstat) == 0 && stat (".", &dotstat) == 0 && dotstat.st_ino == pwdstat.st_ino && dotstat.st_dev == pwdstat.st_dev init_buffer can do this: && dotstat.st_mtime == pwdstat.st_mtime This won't hurt much on non-broken systems, and it should fix the vast majority of the problem on systems where st_ino is broken. > Personally, I think the code in buffer.c could compare normalized file > names as either an alternative or a complementary to the inode method. What's a "normalized file name"? Can it be computed as quickly as an inode number can?