403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/sysutils/inotify-tools/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/sysutils/inotify-tools/files/patch-src_inotifywatch.c
--- src/inotifywatch.c.orig	2021-09-28 08:39:16 UTC
+++ src/inotifywatch.c
@@ -11,6 +11,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
+#ifdef __FreeBSD__
+#include <pthread.h>
+#endif // __FreeBSD__
 #include <limits.h>
 #include <regex.h>
 #include <signal.h>
@@ -96,8 +99,24 @@ int main(int argc, char **argv) {
     char *inc_iregex = NULL;
     int rc;
 
+#ifdef __FreeBSD__
+    sigset_t set, oset;
+#endif // __FreeBSD__
+
     signal(SIGINT, handle_impatient_user);
 
+#ifdef __FreeBSD__
+    // 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);
+#endif // __FreeBSD__
+
     // Parse commandline options, aborting if something goes wrong
     if (!parse_opts(&argc, &argv, &events, &timeout, &verbose, &zero, &sort,
 		    &recursive, &no_dereference, &fromfile, &exc_regex,
@@ -130,6 +149,10 @@ int main(int argc, char **argv) {
 	    warn_inotify_init_error(fanotify);
 	    return EXIT_FAILURE;
     }
+
+#ifdef __FreeBSD__
+    pthread_sigmask(SIG_SETMASK, &oset, NULL);
+#endif // __FreeBSD__
 
     // Attempt to watch file
     // If events is still 0, make it all events.

Youez - 2016 - github.com/yon3zu
LinuXploit