View | Details | Raw Unified | Return to bug 204366 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/inotify-tools/Makefile (-3 / +3 lines)
Lines 2-10 Link Here
2
# $FreeBSD: head/sysutils/inotify-tools/Makefile 400418 2015-10-28 20:52:12Z pawel $
2
# $FreeBSD: head/sysutils/inotify-tools/Makefile 400418 2015-10-28 20:52:12Z pawel $
3
3
4
PORTNAME=	inotify-tools
4
PORTNAME=	inotify-tools
5
PORTVERSION=	3.14
5
PORTVERSION=	3.14.01
6
CATEGORIES=	sysutils
7
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
CATEGORIES=	sysutils
8
8
9
MAINTAINER=	yuri@rawbw.com
9
MAINTAINER=	yuri@rawbw.com
10
COMMENT=	Command-line utilities to watch for file events
10
COMMENT=	Command-line utilities to watch for file events
Lines 15-20 Link Here
15
15
16
USE_GITHUB=	yes
16
USE_GITHUB=	yes
17
GH_ACCOUNT=	rvoicilas
17
GH_ACCOUNT=	rvoicilas
18
GH_TAGNAME=	1df9af4
18
19
19
USES=		autoreconf gmake libtool
20
USES=		autoreconf gmake libtool
20
GNU_CONFIGURE=	yes
21
GNU_CONFIGURE=	yes
Lines 24-29 Link Here
24
25
25
CPPFLAGS+=	-I${LOCALBASE}/include
26
CPPFLAGS+=	-I${LOCALBASE}/include
26
LDFLAGS+=	-L${LOCALBASE}/lib
27
LDFLAGS+=	-L${LOCALBASE}/lib
27
LIBS+=		-linotify
28
28
29
.include <bsd.port.mk>
29
.include <bsd.port.mk>
(-)sysutils/inotify-tools/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (rvoicilas-inotify-tools-v3.14_GH0.tar.gz) = 97a4fdf9132da47c2baa677c1a427c435ee55a26df42b2b74a41489b9fbd2323
1
SHA256 (rvoicilas-inotify-tools-v3.14.01-1df9af4_GH0.tar.gz) = 3cb567344dad1fbe9a935d5a7c3f9c9bbce151df982631eb319763b2708ef4ea
2
SIZE (rvoicilas-inotify-tools-v3.14_GH0.tar.gz) = 66905
2
SIZE (rvoicilas-inotify-tools-v3.14.01-1df9af4_GH0.tar.gz) = 70023
(-)sysutils/inotify-tools/files/patch-configure.ac (+18 lines)
Line 0 Link Here
1
--- configure.ac.orig	2014-11-09 20:57:04 UTC
2
+++ configure.ac
3
@@ -44,6 +44,7 @@ AM_CONDITIONAL([STATIC_BINARY_ENABLE], t
4
 
5
 
6
 # Checks for libraries.
7
+AC_SEARCH_LIBS(inotify_init, inotify)
8
 
9
 # Checks for header files.
10
 AC_CHECK_HEADERS([sys/inotify.h mcheck.h])
11
@@ -62,6 +63,7 @@ AC_C_CONST
12
 AC_C_INLINE
13
 
14
 # Checks for library functions.
15
+AC_CHECK_FUNCS(stat64, [], [CPPFLAGS="$CPPFLAGS -Dstat64=stat -Dlstat64=lstat"])
16
 
17
 # Set variables used in man page templates
18
 MAN_DATE=$(date +'%B %d, %Y')
(-)sysutils/inotify-tools/files/patch-libinotifytools_src_inotifytools.c (-31 lines)
Lines 1-31 Link Here
1
--- libinotifytools/src/inotifytools.c.orig	2010-02-02 14:55:19 UTC
2
+++ libinotifytools/src/inotifytools.c
3
@@ -1309,14 +1309,14 @@ int inotifytools_watch_recursively_with_
4
 
5
 	static struct dirent * ent;
6
 	char * next_file;
7
-	static struct stat64 my_stat;
8
+	static struct stat my_stat;
9
 	ent = readdir( dir );
10
 	// Watch each directory within this directory
11
 	while ( ent ) {
12
 		if ( (0 != strcmp( ent->d_name, "." )) &&
13
 		     (0 != strcmp( ent->d_name, ".." )) ) {
14
 			nasprintf(&next_file,"%s%s", my_path, ent->d_name);
15
-			if ( -1 == lstat64( next_file, &my_stat ) ) {
16
+			if ( -1 == lstat( next_file, &my_stat ) ) {
17
 				error = errno;
18
 				free( next_file );
19
 				if ( errno != EACCES ) {
20
@@ -1595,9 +1595,9 @@ int inotifytools_error() {
21
  * @internal
22
  */
23
 int isdir( char const * path ) {
24
-	static struct stat64 my_stat;
25
+	static struct stat my_stat;
26
 
27
-	if ( -1 == lstat64( path, &my_stat ) ) {
28
+	if ( -1 == lstat( path, &my_stat ) ) {
29
 		if (errno == ENOENT) return 0;
30
 		fprintf(stderr, "Stat failed on %s: %s\n", path, strerror(errno));
31
 		return 0;
(-)sysutils/inotify-tools/files/patch-src_Makefile.am (+16 lines)
Line 0 Link Here
1
--- src/Makefile.am.orig	2014-11-09 20:57:04 UTC
2
+++ src/Makefile.am
3
@@ -2,10 +2,11 @@ bin_PROGRAMS = inotifywait inotifywatch
4
 inotifywait_SOURCES = inotifywait.c common.c common.h
5
 inotifywatch_SOURCES = inotifywatch.c common.c common.h
6
 
7
-AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src
8
+AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99
9
 AM_CPPFLAGS = -I$(top_srcdir)/libinotifytools/src
10
 LDADD = ../libinotifytools/src/libinotifytools.la
11
+AM_LDFLAGS =  -L$(top_srcdir)/libinotifytools/src
12
 
13
 if STATIC_BINARY_ENABLE
14
-AM_LDFLAGS = -static-libtool-libs
15
+AM_LDFLAGS += -static-libtool-libs
16
 endif
(-)sysutils/inotify-tools/files/patch-src_inotifywatch.c (+50 lines)
Line 0 Link Here
1
--- src/inotifywatch.c.orig	2015-11-09 01:40:46 UTC
2
+++ src/inotifywatch.c
3
@@ -12,6 +12,9 @@
4
 #include <errno.h>
5
 #include <fcntl.h>
6
 #include <getopt.h>
7
+#ifdef __FreeBSD__
8
+#include <pthread.h>
9
+#endif // __FreeBSD__
10
 #include <regex.h>
11
 #include <signal.h>
12
 #include <stdbool.h>
13
@@ -93,6 +96,9 @@ int main(int argc, char ** argv)
14
 	char * exc_iregex = NULL;
15
 	char * inc_regex = NULL;
16
 	char * inc_iregex = NULL;
17
+#ifdef __FreeBSD__
18
+	sigset_t set, oset;
19
+#endif // __FreeBSD__
20
 
21
 	signal( SIGINT, handle_impatient_user );
22
 
23
@@ -121,11 +127,27 @@ int main(int argc, char ** argv)
24
 		return EXIT_FAILURE;
25
 	}
26
 
27
+#ifdef __FreeBSD__
28
+	// Block some signals in libinotify's worker thread, so that
29
+	// handle_signal runs in the context of the main thread and
30
+	// the 'done' flag is actually honored.
31
+	sigemptyset(&set);
32
+	sigaddset(&set, SIGINT);
33
+	sigaddset(&set, SIGHUP);
34
+	sigaddset(&set, SIGTERM);
35
+	sigaddset(&set, SIGALRM);
36
+	pthread_sigmask(SIG_BLOCK, &set, &oset);
37
+#endif // __FreeBSD__
38
+
39
 	if ( !inotifytools_initialize() ) {
40
 		warn_inotify_init_error();
41
 		return EXIT_FAILURE;
42
 	}
43
 
44
+#ifdef __FreeBSD__
45
+	pthread_sigmask(SIG_SETMASK, &oset, NULL);
46
+#endif // __FreeBSD__
47
+
48
 	// Attempt to watch file
49
 	// If events is still 0, make it all events.
50
 	if ( !events )

Return to bug 204366