X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.c;h=091ced9316e9220408fb7799004c297b8c0fd9ec;hb=e6da8bc0d56d3106d663ab056b1ca484713f4d77;hp=a44f39f2394097863c14de256801984d9e6907f3;hpb=7b01c4762ae242d2114cc6a59994f678b7d253fc;p=nfs-utils.git diff --git a/utils/statd/statd.c b/utils/statd/statd.c index a44f39f..091ced9 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -249,7 +249,6 @@ int main (int argc, char **argv) int arg; int port = 0, out_port = 0; struct rlimit rlim; - int once = 1; int pipefds[2] = { -1, -1}; char status; @@ -485,24 +484,22 @@ int main (int argc, char **argv) */ load_state(); - for (;;) { - pmap_unset (SM_PROG, SM_VERS); + pmap_unset (SM_PROG, SM_VERS); - /* If we got this far, we have successfully started, so notify parent */ - if (pipefds[1] > 0) { - status = 0; - write(pipefds[1], &status, 1); - close(pipefds[1]); - pipefds[1] = -1; - } + /* this registers both UDP and TCP services */ + rpc_init("statd", SM_PROG, SM_VERS, sm_prog_1, port); - /* this registers both UDP and TCP services */ - rpc_init("statd", SM_PROG, SM_VERS, sm_prog_1, port); + /* If we got this far, we have successfully started, so notify parent */ + if (pipefds[1] > 0) { + status = 0; + write(pipefds[1], &status, 1); + close(pipefds[1]); + pipefds[1] = -1; + } - if (once) { - once = 0; - drop_privs(); - } + drop_privs(); + + for (;;) { /* * Handle incoming requests: SM_NOTIFY socket requests, as * well as callbacks from lockd.