From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification Date: Sat, 27 Apr 2019 19:52:56 +0300 Message-ID: <83d0l7v193.fsf@gnu.org> References: <83sgu71b91.fsf@gnu.org> <74CB5185-5DA1-4786-BD9C-9EEB3D43B3C1@acm.org> <83o94uz9h2.fsf@gnu.org> <875zqzssql.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100919"; mail-complaints-to="usenet@blaine.gmane.org" Cc: michael.albinus@gmx.de, 35418@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 27 19:01:05 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKQhD-000Q4N-EU for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Apr 2019 19:01:03 +0200 Original-Received: from localhost ([127.0.0.1]:34310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKQhC-00024J-CF for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Apr 2019 13:01:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKQeU-0008IQ-1p for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2019 12:58:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKQaR-0005q8-0E for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2019 12:54:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50597) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hKQaQ-0005oe-KC for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2019 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hKQaQ-0008Ep-CZ for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2019 12:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2019 16:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35418-submit@debbugs.gnu.org id=B35418.155638399831589 (code B ref 35418); Sat, 27 Apr 2019 16:54:02 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 27 Apr 2019 16:53:18 +0000 Original-Received: from localhost ([127.0.0.1]:35906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKQZh-0008DR-O9 for submit@debbugs.gnu.org; Sat, 27 Apr 2019 12:53:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKQZg-0008DD-1T for 35418@debbugs.gnu.org; Sat, 27 Apr 2019 12:53:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKQZa-0005Cw-MJ; Sat, 27 Apr 2019 12:53:10 -0400 Original-Received: from [176.228.60.248] (port=4847 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hKQZZ-0007AZ-JN; Sat, 27 Apr 2019 12:53:10 -0400 In-reply-to: (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Sat, 27 Apr 2019 18:19:36 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158364 Archived-At: > From: Mattias EngdegÄrd > Date: Sat, 27 Apr 2019 18:19:36 +0200 > Cc: Eli Zaretskii , 35418@debbugs.gnu.org > > The reason is that file-notify does not call inotify-add-watch on individual files, as in your example above, but on their containing directory ("/tmp" in your example). When monitoring a directory with two hard links to the same file, and the file is changed, inotify (sensibly) only reports a change to one of the links (the one employed for the change). Thus, the logic is in the Linux kernel, not in filenotify. > > For kqueue it is different: here, changes to files are not reported when a watch is monitoring their directory, so filenotify.el sets kqueue watches on each file instead. The same could be done with inotify (and w32notify, if I read the code right), but watching directories has certain advantages. w32notify cannot watch a single file, because the Windows notification machinery is directory-oriented, and reports all changes in the directory.