bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21337: 25.0.50; inotify error message


From: Robert Pluim
Subject: bug#21337: 25.0.50; inotify error message
Date: Mon, 24 Aug 2015 20:32:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>
> Strange.  Does auto-revert-mode work in "emacs -Q"?  Do the related
> tests in the test suite pass?
>

Yes and yes.

> Can you use strace to see what error is that and what directory is
> being watched?

strace indicates that the directory where emacs is being run from is
being watched, along with my home directory plus any directories
containing files that are being visited. What's strange is that
inotify_add_watch is being called 22 times for the current directory.

I've debugged inotify_callback a little. The expectation of this code

  to_read = 0;
  if (ioctl (fd, FIONREAD, &to_read) == -1)
    xsignal1
      (Qfile_notify_error,
       build_string ("Error while trying to retrieve file system events"));
  buffer = xmalloc (to_read);
  n = read (fd, buffer, to_read);
  if (n < 0)
    {

is that the read will succeed, however to_read is very often 0, so
it's not surprising the read fails. (what does xmalloc do when its
argument is 0?)

My understanding was that the callback should only be called when
there are actual inotify events to process, so this behaviour is
somewhat surprising to me.

I can add in skipping the read if to_read == 0, but I suspect that's
just papering over the cracks.

Regards

Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]