This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nscd/14906] inotify failed when /etc/hosts file change


http://sourceware.org/bugzilla/show_bug.cgi?id=14906

--- Comment #1 from Bin Li <binli at opensuse dot org> 2012-12-03 10:38:53 UTC ---
The original bug is from SUSE Linux.
https://bugzilla.novell.com/show_bug.cgi?id=779531

Michael Matz's comments.
--------------------------------
I can make the program work as expected also in the light of overwriting
renames, when I'm handling a IN_IGNORED event by recreating the watch on
/etc/hosts, like this in the inner loop:

      if (buf.wd == watch && (buf.mask & IN_IGNORED) != 0)
        {
          /* Recreate watch */
          watch = inotify_add_watch (fd, "/etc/hosts", IN_DELETE_SELF |
IN_MODIFY /* | IN_MOVE */);
          printf ("Added watch on /etc/hosts, as watch %d\n", watch);
          if (watch < 0)
            bark ("inotify_add_watch");
        }

That's for sure surprising limitation of the interface.  Is this really how
it's supposed to be used?
--------------------------------

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]