X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fsvc_run.c;h=7b69dc8938e744dcc0161026adbc356382df0eb7;hp=0adbbbeddeed5159ca5c4e6821e04e0686d45460;hb=8d926d3defedf7bb82c2f3f9fd1746fb0d0b968a;hpb=2b564ceca4764b9191b7a5f15808d42ebb26f537 diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c index 0adbbbe..7b69dc8 100644 --- a/utils/statd/svc_run.c +++ b/utils/statd/svc_run.c @@ -60,6 +60,7 @@ static int svc_stop = 0; * requests are put. */ notify_list * notify = NULL; +int re_notify = 0; /* * Jump-off function. @@ -86,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)) { @@ -98,12 +103,14 @@ 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."); + } else if (run_mode & MODE_NOTIFY_ONLY) + return; + else { + dprintf(N_DEBUG, "Waiting for client connections."); selret = select(FD_SETSIZE, &readfds, (void *) 0, (void *) 0, (struct timeval *) 0); } @@ -113,7 +120,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: