From: Neil Brown Date: Thu, 29 Mar 2007 03:08:06 +0000 (+1000) Subject: statd - remove a pointless if X-Git-Tag: nfs-utils-1-1-0-rc1~8 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=e6da8bc0d56d3106d663ab056b1ca484713f4d77 statd - remove a pointless if The if contains a while with essentially the same condition. Signed-off-by: Neil Brown --- diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c index b452082..5fcab1d 100644 --- a/utils/statd/monitor.c +++ b/utils/statd/monitor.c @@ -139,27 +139,25 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp) * I'll just do a quickie success return and things should * be happy. */ - if (rtnl) { - notify_list *temp = rtnl; - - while ((temp = nlist_gethost(temp, mon_name, 0))) { - if (matchhostname(NL_MY_NAME(temp), my_name) && - NL_MY_PROC(temp) == id->my_proc && - NL_MY_PROG(temp) == id->my_prog && - NL_MY_VERS(temp) == id->my_vers) { - /* Hey! We already know you guys! */ - dprintf(N_DEBUG, - "Duplicate SM_MON request for %s " - "from procedure on %s", - mon_name, my_name); + clnt = rtnl; - /* But we'll let you pass anyway. */ - result.res_stat = STAT_SUCC; - result.state = MY_STATE; - return (&result); - } - temp = NL_NEXT(temp); + while ((clnt = nlist_gethost(clnt, mon_name, 0))) { + if (matchhostname(NL_MY_NAME(clnt), my_name) && + NL_MY_PROC(clnt) == id->my_proc && + NL_MY_PROG(clnt) == id->my_prog && + NL_MY_VERS(clnt) == id->my_vers) { + /* Hey! We already know you guys! */ + dprintf(N_DEBUG, + "Duplicate SM_MON request for %s " + "from procedure on %s", + mon_name, my_name); + + /* But we'll let you pass anyway. */ + result.res_stat = STAT_SUCC; + result.state = MY_STATE; + return (&result); } + clnt = NL_NEXT(clnt); } /*