# Add top source directory for all builds so we can use config.h
INCLUDES="$INCLUDES -I\$(abs_top_srcdir)"
+# Check inotify availability
+AC_CHECK_HEADER([sys/inotify.h], AC_DEFINE([HAVE_INOTIFY],[1],[Define if we have inotify]),)
+
# Checks for boost headers using CXX instead of CC
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library))
*
*/
+#include "config.h"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
+#ifdef HAVE_INOTIFY
#include <sys/inotify.h>
+#endif
#include <limits.h>
#include <unistd.h>
#include "LIRC.h"
close(m_fd);
m_fd = -1;
m_file = NULL;
+#ifdef HAVE_INOTIFY
if (m_inotify_wd >= 0) {
inotify_rm_watch(m_inotify_fd, m_inotify_wd);
m_inotify_wd = -1;
}
if (m_inotify_fd >= 0)
close(m_inotify_fd);
+#endif
m_inReply = false;
m_nrSending = 0;
{
if ((m_file = fdopen(m_fd, "r+")) != NULL)
{
+#ifdef HAVE_INOTIFY
// Setup inotify so we can disconnect if lircd is restarted
if ((m_inotify_fd = inotify_init()) >= 0)
{
}
}
}
+#else
+ m_bInitialized = true;
+ CLog::Log(LOGINFO, "LIRC %s: sucessfully started", __FUNCTION__);
+#endif
}
else
CLog::Log(LOGERROR, "LIRC %s: fdopen failed: %s", __FUNCTION__, strerror(errno));
}
bool CRemoteControl::CheckDevice() {
+#ifdef HAVE_INOTIFY
if (m_inotify_fd < 0 || m_inotify_wd < 0)
return true; // inotify wasn't setup for some reason, assume all is well
int bufsize = sizeof(struct inotify_event) + PATH_MAX;
}
i += sizeof(struct inotify_event)+e->len;
}
+#endif
return true;
}