summaryrefslogtreecommitdiff
path: root/src/libstrongswan/processing
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
commit5313d2d78ca150515f7f5eb39801c100690b6b29 (patch)
treec78e420367283bb1b16f14210b12687cdfbd26eb /src/libstrongswan/processing
parent6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (diff)
downloadvyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.tar.gz
vyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.zip
Imported Upstream version 5.1.1
Diffstat (limited to 'src/libstrongswan/processing')
-rw-r--r--src/libstrongswan/processing/watcher.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libstrongswan/processing/watcher.c b/src/libstrongswan/processing/watcher.c
index 3009be608..9773e7601 100644
--- a/src/libstrongswan/processing/watcher.c
+++ b/src/libstrongswan/processing/watcher.c
@@ -45,6 +45,11 @@ struct private_watcher_t {
linked_list_t *fds;
/**
+ * Pending update of FD list?
+ */
+ bool pending;
+
+ /**
* Lock to access FD list
*/
mutex_t *mutex;
@@ -106,6 +111,7 @@ static void update(private_watcher_t *this)
{
char buf[1] = { 'u' };
+ this->pending = TRUE;
if (this->notify[1] != -1)
{
ignore_result(write(this->notify[1], buf, sizeof(buf)));
@@ -294,6 +300,7 @@ static job_requeue_t watch(private_watcher_t *this)
{
DBG2(DBG_JOB, "watcher got notification, rebuilding");
while (read(this->notify[0], buf, sizeof(buf)) > 0);
+ this->pending = FALSE;
return JOB_REQUEUE_DIRECT;
}
@@ -333,7 +340,11 @@ static job_requeue_t watch(private_watcher_t *this)
}
else
{
- DBG1(DBG_JOB, "watcher select() error: %s", strerror(errno));
+ if (!this->pending)
+ { /* complain only if no pending updates */
+ DBG1(DBG_JOB, "watcher select() error: %s", strerror(errno));
+ }
+ return JOB_REQUEUE_DIRECT;
}
}
}