From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: patch to fileio.c Date: Fri, 14 Nov 2008 16:11:09 -0500 Message-ID: <874p2adnde.fsf@cyd.mit.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226697125 9559 80.91.229.12 (14 Nov 2008 21:12:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 21:12:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Fabrice Popineau" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 14 22:13:07 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L15yN-0002IO-BX for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2008 22:13:00 +0100 Original-Received: from localhost ([127.0.0.1]:40297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L15xF-0003Fx-3S for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2008 16:11:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L15wQ-0002jz-3f for emacs-devel@gnu.org; Fri, 14 Nov 2008 16:10:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L15wN-0002j2-Pw for emacs-devel@gnu.org; Fri, 14 Nov 2008 16:10:57 -0500 Original-Received: from [199.232.76.173] (port=45005 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L15wN-0002iv-Kf for emacs-devel@gnu.org; Fri, 14 Nov 2008 16:10:55 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:51164) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L15wN-0005ON-H3 for emacs-devel@gnu.org; Fri, 14 Nov 2008 16:10:55 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id D3DB857E195; Fri, 14 Nov 2008 16:11:09 -0500 (EST) In-Reply-To: (Fabrice Popineau's message of "Sun, 26 Oct 2008 16:15:28 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105689 Archived-At: "Fabrice Popineau" writes: > You should consider adding the following patch. As I reported earlier, > the fd file descriptor may be closed twice in insert-file-contents. It > happens every time a file is visited and this same file is modified > outside emacs. In this case, you can ask to visit the file again (or > emacs will ask you if you try to save it) > > "File foobar.txt changed on disk. Reread from disk? (yes or no)" > > The fd file descriptor in this case is closed by emacs_close() at line > 3654 and by close_file_unwind() registered at line 3233. When > emacs_close(fd) is reached, the unwind_protect registered function > should be removed. Unfortunately, in the mean time other stuff has > been put in the unwind_protect stack, so you can't just decrement the > pointer. It can be done when the handled: label is reached. Hence the > flag in my patch. I've checked in your patch. Thanks.