Sourceware Bugzilla – Attachment 6771 Details for
Bug 14906
inotify failed when /etc/hosts file change
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
the patch for suggested fix
bug-779531_nscd-dont-rely-on-buggy-inotify.patch (text/plain), 1.41 KB, created by
Bin Li
on 2012-12-03 10:42:29 UTC
(
hide
)
Description:
the patch for suggested fix
Filename:
MIME Type:
Creator:
Bin Li
Created:
2012-12-03 10:42:29 UTC
Size:
1.41 KB
patch
obsolete
>Index: glibc-2.11.3/nscd/cache.c >=================================================================== >--- glibc-2.11.3.orig/nscd/cache.c 2012-10-18 06:34:23.000000000 +0200 >+++ glibc-2.11.3/nscd/cache.c 2012-10-18 11:15:44.000000000 +0200 >@@ -264,7 +264,6 @@ prune_cache (struct database_dyn *table, > > /* If we check for the modification of the underlying file we invalidate > the entries also in this case. */ >- if (table->inotify_descr < 0 && table->check_file && now != LONG_MAX) > { > struct stat64 st; > time_t mtime; >Index: glibc-2.11.3/nscd/connections.c >=================================================================== >--- glibc-2.11.3.orig/nscd/connections.c 2012-10-18 06:34:23.000000000 +0200 >+++ glibc-2.11.3/nscd/connections.c 2012-10-18 11:20:45.000000000 +0200 >@@ -848,11 +848,14 @@ cannot set socket to close on exec: %s; > if (dbs[cnt].check_file) > { > #ifdef HAVE_INOTIFY >- if (inotify_fd < 0 >- || (dbs[cnt].inotify_descr >+ if (inotify_fd >= 0) >+ { >+ dbs[cnt].inotify_descr > = inotify_add_watch (inotify_fd, dbs[cnt].filename, >- IN_DELETE_SELF | IN_MODIFY)) < 0) >- /* We cannot notice changes in the main thread. */ >+ IN_DELETE_SELF | IN_MODIFY); >+ } >+ /* Always fall back to checking file modification times. In its >+ current form the inotify check is totally unreliable */ > #endif > { > /* We need the modification date of the file. */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14906
:
6770
| 6771 |
8137