This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nscd/14906] inotify failed when /etc/hosts file change
- From: "binli at opensuse dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Mon, 03 Dec 2012 10:38:53 +0000
- Subject: [Bug nscd/14906] inotify failed when /etc/hosts file change
- Auto-submitted: auto-generated
- References: <bug-14906-131@http.sourceware.org/bugzilla/>
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.