summaryrefslogtreecommitdiffstats
path: root/utils/statd/monitor.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-09-26 16:13:45 -0400
committerSteve Dickson <steved@redhat.com>2008-09-26 16:13:45 -0400
commit9b13713fa592b02da0dc79c5505fdf7002155d13 (patch)
tree57249ffcb070f887226618c07e521194ad6f6c8f /utils/statd/monitor.c
parent2fd04076023d696e5e7ffa17998e9d32990e57bf (diff)
downloadnfs-utils-9b13713fa592b02da0dc79c5505fdf7002155d13.tar.gz
nfs-utils-9b13713fa592b02da0dc79c5505fdf7002155d13.tar.xz
nfs-utils-9b13713fa592b02da0dc79c5505fdf7002155d13.zip
rpc.statd: Clean up: replace "if (!(foo = rtnl))".
Static code checkers flag this kind of thing because it's easy to confuse with "if (!(foo == rtnl))". In one of these cases, the combination of evaluation and assignment isn't even necessary. While we are in the neighborhood, remove an extra argument to note() that is not called for in the passed-in format string. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd/monitor.c')
-rw-r--r--utils/statd/monitor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c
index d300338..a6a1d9c 100644
--- a/utils/statd/monitor.c
+++ b/utils/statd/monitor.c
@@ -326,12 +326,13 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp)
/* Check if we're monitoring anyone. */
- if (!(clnt = rtnl)) {
+ if (rtnl == NULL) {
note(N_WARNING,
"Received SM_UNMON request from %s for %s while not "
"monitoring any hosts.", my_name, argp->mon_name);
return (&result);
}
+ clnt = rtnl;
/*
* OK, we are. Now look for appropriate entry in run-time list.
@@ -379,11 +380,12 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp)
result.state = MY_STATE;
- if (!(clnt = rtnl)) {
+ if (rtnl == NULL) {
note(N_WARNING, "Received SM_UNMON_ALL request from %s "
"while not monitoring any hosts", my_name);
return (&result);
}
+ clnt = rtnl;
while ((clnt = nlist_gethost(clnt, my_name, 1))) {
if (NL_MY_PROC(clnt) == argp->my_proc &&