GNU bug report logs - #13662
24.3.50; inotify-add-watch fails in batch mode

Previous Next

Package: emacs;

Reported by: Chong Yidong <cyd <at> gnu.org>

Date: Sat, 9 Feb 2013 14:37:02 UTC

Severity: important

Found in version 24.3.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 13662 <at> debbugs.gnu.org
Subject: bug#13662: 24.3.50; inotify-add-watch fails in batch mode
Date: Sat, 25 Jan 2014 16:16:57 +0200
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Date: Fri, 17 Jan 2014 12:56:51 +0100
> Cc: 13662-done <at> debbugs.gnu.org
> 
> Chong Yidong <cyd <at> gnu.org> writes:
> 
> > Another way to see this is to create a file with the contents
> >
> > (let* ((temp-file (make-temp-file "inotify-simple"))
> >        (events 0)
> >        (wd
> > 	(inotify-add-watch temp-file t (lambda (ev)
> > 					 (setq events (1+ events))))))
> >   (unwind-protect
> >       (progn
> > 	(with-temp-file temp-file
> > 	  (insert "Foo\n"))
> > 	(sit-for 5)
> > 	(message ">> %d <<" events))
> >     (inotify-rm-watch wd)))
> >
> > and run `emacs -batch -l foo.el'.  This prints ">> 0 <<", indicating
> > that the inotify watcher failed to run.  If you repeat omitting -batch,
> > ">> 4 <<" is printed, as expected.
> 
> Should be fixed with r116052. Instead of `sit-for', one needs to apply
> `read-event'.

This breaks the file-notify-test02-events test on w32.  It looks like
read-event never returns there.  If I replace that with sit-for, it
does return, but the test still fails because
file-notify--test-results remains nil, something that wasn't being
tested when I last ran the test (in early December).

Frankly, given the inordinate amount of work it took to try to get
file notifications work in batch mode, I'd rather we declared they are
not expected to work in batch, and moved on.  If you, for some reason,
still want to stick with that test, please mark
file-notify-test02-events to be skipped for w32, as I'm tired of
fixing the breakage there time and again.  Thanks.




This bug report was last modified 11 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.