From db7773aa542f9678bd9b9712d0e3c017ae1bcdcf Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 23 May 2012 16:55:26 -0700 Subject: [PATCH] linux crl dir monitoring fixes --- configure.ac | 2 +- src/crl.c | 7 ++++--- src/include.am | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index ff8a15b3d..7a99cb230 100644 --- a/configure.ac +++ b/configure.ac @@ -500,7 +500,7 @@ AC_ARG_ENABLE(crl, if test "$ENABLED_CRL" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL" + AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL -DHAVE_CRL_MONITOR" fi AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"]) diff --git a/src/crl.c b/src/crl.c index 96705ecdc..8bf88c59e 100644 --- a/src/crl.c +++ b/src/crl.c @@ -393,7 +393,8 @@ static void* DoMonitor(void* arg) #elif __linux__ #include -#include +#include +#include /* linux monitoring */ static void* DoMonitor(void* arg) @@ -411,7 +412,7 @@ static void* DoMonitor(void* arg) } if (crl->monitors[0].path) { - wd = inotify_add_watch(notifyFd, crl->monitors[0].path, IN_CREATE | + wd = inotify_add_watch(notifyFd, crl->monitors[0].path, IN_CLOSE_WRITE | IN_DELETE); if (wd < 0) { CYASSL_MSG("PEM notify add watch failed"); @@ -420,7 +421,7 @@ static void* DoMonitor(void* arg) } if (crl->monitors[1].path) { - wd = inotify_add_watch(notifyFd, crl->monitors[1].path, IN_CREATE | + wd = inotify_add_watch(notifyFd, crl->monitors[1].path, IN_CLOSE_WRITE | IN_DELETE); if (wd < 0) { CYASSL_MSG("DER notify add watch failed"); diff --git a/src/include.am b/src/include.am index 9890a8f7e..95c7c026d 100644 --- a/src/include.am +++ b/src/include.am @@ -72,5 +72,7 @@ endif if BUILD_CRL src_libcyassl_la_SOURCES += src/crl.c +src_libcyassl_la_CFLAGS += $(PTHREAD_CFLAGS) +src_libcyassl_la_LIBADD += $(PTHREAD_LIBS) endif