X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fsvc_run.c;h=f6bcbb906df907cd847cbe57d5a042d008c89abe;hb=72913e3a0498e2099800de53871b696c72feda1b;hp=393a2fd84803ff5ef57ceffa613f767b1d8cecbd;hpb=430052cab3c8044ef6d1be7b5a5ded13c45d0c40;p=nfs-utils.git diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c index 393a2fd..f6bcbb9 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,13 @@ my_svc_run(void) for (;;) { if (svc_stop) return; + if (re_notify) { + change_state(); + dprintf(N_DEBUG, "Notifying...(new state %d)", + MY_STATE); + notify_hosts(); + re_notify = 0; + } /* Ah, there are some notifications to be processed */ while (notify && NL_WHEN(notify) <= time(&now)) { @@ -102,7 +110,9 @@ my_svc_run(void) tv.tv_sec); selret = select(FD_SETSIZE, &readfds, (void *) 0, (void *) 0, &tv); - } else { + } 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);