]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/svc_run.c
Support --ha-callout for high-availability callouts
[nfs-utils.git] / utils / statd / svc_run.c
index 8f6d9feb071b3d5b8d0eef427e54dc728c2c2b14..e2d7c975df91a7014e55de09277ac833d0558f76 100644 (file)
@@ -49,6 +49,7 @@
  */
 #include "config.h"
 #include <errno.h>
+#include <time.h>
 #include "statd.h"
 #include "notlist.h"
 
@@ -59,6 +60,7 @@ static int    svc_stop = 0;
  * requests are put.
  */
 notify_list *  notify = NULL;
+int    re_notify = 0;
 
 /*
  * Jump-off function.
@@ -85,6 +87,10 @@ my_svc_run(void)
        for (;;) {
                if (svc_stop)
                        return;
+               if (re_notify) {
+                       notify_hosts();
+                       re_notify = 0;
+               }
 
                /* Ah, there are some notifications to be processed */
                while (notify && NL_WHEN(notify) <= time(&now)) {
@@ -97,12 +103,12 @@ my_svc_run(void)
 
                        tv.tv_sec  = NL_WHEN(notify) - now;
                        tv.tv_usec = 0;
-                       dprintf(L_DEBUG, "Waiting for reply... (timeo %d)",
+                       dprintf(N_DEBUG, "Waiting for reply... (timeo %d)",
                                                        tv.tv_sec);
                        selret = select(FD_SETSIZE, &readfds,
                                (void *) 0, (void *) 0, &tv);
                } else {
-                       dprintf(L_DEBUG, "Waiting for client connections.");
+                       dprintf(N_DEBUG, "Waiting for client connections.");
                        selret = select(FD_SETSIZE, &readfds,
                                (void *) 0, (void *) 0, (struct timeval *) 0);
                }
@@ -112,7 +118,7 @@ my_svc_run(void)
                        if (errno == EINTR || errno == ECONNREFUSED
                         || errno == ENETUNREACH || errno == EHOSTUNREACH)
                                continue;
-                       log(L_ERROR, "my_svc_run() - select: %m");
+                       note(N_ERROR, "my_svc_run() - select: %m");
                        return;
 
                case 0: