GNOME Bugzilla – Bug 476938
gamin polls frequently when trying to watch non-existant directory
Last modified: 2008-04-06 18:10:12 UTC
(from https://bugzilla.redhat.com/show_bug.cgi?id=240385) strace -p `pidof gam_server` shows that gnome is looking for a bunch of directories in /etc/xdg and in ~, for menus. These aren't there by dfault, so gamin has to poll to see if they get created....
Created attachment 95596 [details] [review] watch directory parent to get notified that directory becomes available The problem seems to be that gamin calls inotify_add_watch ("/some/dir/here") in a loop and each time gets back ENOENT. The above patch makes it watch "/some/dir" to find out when "here" shows up, or watch "/some" to find out when "/some/dir" shows up.
Yes, that's a long standing limitation in that code and I think your patch fixes it in a nice way, feel free to patch in SVN, thanks a lot ! Daniel
sorry for the long delay on this one. commited to trunk: 2008-04-04 Ray Strode <rstrode@redhat.com> * server/inotify-path.c (ip_watch_parent), (ip_start_watching), (ip_event_dispatch), (ip_event_callback): If a file being watched doesn't exist yet, then watch its parent to find out when it shows up instead of polling (bug 476938).