From 8de8a8dc505523fd0726964ba148751422ec01da Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Wed, 11 Feb 2009 08:44:24 +0000 Subject: [PATCH] * Use our own inotify headers if the system does not have them * Don't rely on signal.h to include linux/types.h (for __u32 definition) --- genconfig.sh | 8 ++++++++ inotify.c | 5 +++++ upnpglobalvars.h | 3 +-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/genconfig.sh b/genconfig.sh index 9bd7089..6213e75 100755 --- a/genconfig.sh +++ b/genconfig.sh @@ -138,6 +138,14 @@ echo " * of BSD daemon() */" >> ${CONFIGFILE} echo "#define USE_DAEMON" >> ${CONFIGFILE} echo "" >> ${CONFIGFILE} +echo "/* Enable if the system inotify.h exists. Otherwise our own inotify.h will be used. */" >> ${CONFIGFILE} +if [ -f /usr/include/sys/inotify.h ]; then +echo "#define HAVE_INOTIFY_H" >> ${CONFIGFILE} +else +echo "/*#define HAVE_INOTIFY_H*/" >> ${CONFIGFILE} +fi +echo "" >> ${CONFIGFILE} + echo "/* Experimental UPnP Events support. */" >> ${CONFIGFILE} echo "#define ENABLE_EVENTS" >> ${CONFIGFILE} echo "" >> ${CONFIGFILE} diff --git a/inotify.c b/inotify.c index 93d38f2..63be69e 100644 --- a/inotify.c +++ b/inotify.c @@ -7,7 +7,12 @@ #include #include #include +#ifdef HAVE_INOTIFY_H #include +#else +#include "inotify-includes/inotify.h" +#include "inotify-includes/inotify-syscalls.h" +#endif #include "upnpglobalvars.h" #include "utils.h" diff --git a/upnpglobalvars.h b/upnpglobalvars.h index 4c9e32f..bdc026d 100644 --- a/upnpglobalvars.h +++ b/upnpglobalvars.h @@ -8,7 +8,7 @@ #define __UPNPGLOBALVARS_H__ #include -#include // Defines __u32 +#include // Defines __u32 #include "minidlnatypes.h" #include "config.h" @@ -54,7 +54,6 @@ extern struct runtime_vars_s runtime_vars; extern int runtime_flags; #define INOTIFYMASK 0x0001 #define SYSUPTIMEMASK 0x0002 -#define CHECKCLIENTIPMASK 0x0008 #define SETFLAG(mask) runtime_flags |= mask #define GETFLAG(mask) runtime_flags & mask