FreeBSD Bugzilla – Attachment 162903 Details for
Bug 204366
sysutils/inotify-tools: Update to 3.14.40 (Fixes inotifywatch)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
inotifywatch fix for 3.14
0001-sysutils-inotify-tools-Fix-inotifywatch-for-v3.14.patch (text/plain), 2.44 KB, created by
wjenkner
on 2015-11-08 16:13:17 UTC
(
hide
)
Description:
inotifywatch fix for 3.14
Filename:
MIME Type:
Creator:
wjenkner
Created:
2015-11-08 16:13:17 UTC
Size:
2.44 KB
patch
obsolete
>From f141c06d47509e3621a14fd7d24f96e919167dea Mon Sep 17 00:00:00 2001 >From: Wolfgang Jenkner <wjenkner@inode.at> >Date: Sun, 8 Nov 2015 16:38:11 +0100 >Subject: [PATCH 1/2] sysutils/inotify-tools: Fix inotifywatch for v3.14 > >The patch to src/inotifywatch.c works around an incompatibility >between libinotify and native Linux inotify, which should perhaps be >addressed in libinotify at some point. > >Also, it changes the polling event loop to a blocking one, as upstream >did this in commit a85bab1. >--- > .../inotify-tools/files/patch-src_inotifywatch.c | 53 ++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > create mode 100644 sysutils/inotify-tools/files/patch-src_inotifywatch.c > >diff --git a/sysutils/inotify-tools/files/patch-src_inotifywatch.c b/sysutils/inotify-tools/files/patch-src_inotifywatch.c >new file mode 100644 >index 0000000..cbf5764 >--- /dev/null >+++ b/sysutils/inotify-tools/files/patch-src_inotifywatch.c >@@ -0,0 +1,53 @@ >+--- src/inotifywatch.c.orig 2015-11-08 15:17:11 UTC >++++ src/inotifywatch.c >+@@ -12,6 +12,7 @@ >+ #include <errno.h> >+ #include <fcntl.h> >+ #include <getopt.h> >++#include <pthread.h> >+ #include <regex.h> >+ #include <signal.h> >+ #include <stdbool.h> >+@@ -91,6 +92,7 @@ int main(int argc, char ** argv) >+ done = false; >+ char * regex = NULL; >+ char * iregex = NULL; >++ sigset_t set, oset; >+ >+ signal( SIGINT, handle_impatient_user ); >+ >+@@ -109,6 +111,16 @@ int main(int argc, char ** argv) >+ return EXIT_FAILURE; >+ } >+ >++ // Block some signals in libinotify's worker thread, so that >++ // handle_signal runs in the context of the main thread and >++ // the `done' flag is actually honored. >++ sigemptyset(&set); >++ sigaddset(&set, SIGINT); >++ sigaddset(&set, SIGHUP); >++ sigaddset(&set, SIGTERM); >++ sigaddset(&set, SIGALRM); >++ pthread_sigmask(SIG_BLOCK, &set, &oset); >++ >+ if ( !inotifytools_initialize() ) { >+ fprintf(stderr, "Couldn't initialize inotify. Are you running Linux " >+ "2.6.13 or later, and was the\n" >+@@ -120,6 +132,8 @@ int main(int argc, char ** argv) >+ return EXIT_FAILURE; >+ } >+ >++ pthread_sigmask(SIG_SETMASK, &oset, NULL); >++ >+ // Attempt to watch file >+ // If events is still 0, make it all events. >+ if ( !events ) >+@@ -195,7 +209,7 @@ int main(int argc, char ** argv) >+ char * moved_from = 0; >+ >+ do { >+- event = inotifytools_next_event( 0 ); >++ event = inotifytools_next_event( -1 ); >+ if ( !event ) { >+ if ( !inotifytools_error() ) { >+ return EXIT_TIMEOUT; >-- >2.6.2 >
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 204366
:
162885
| 162903 |
162904
|
163214
|
163215
|
164261