Module Name: src
Committed By: lukem
Date: Sat Apr 18 13:04:50 UTC 2009
Modified Files:
src/usr.sbin/rpc.statd: stat_proc.c statd.c
Log Message:
Fix -Wshadow and -Wcast-qual issues
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/rpc.statd/stat_proc.c
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/rpc.statd/statd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/rpc.statd/stat_proc.c
diff -u src/usr.sbin/rpc.statd/stat_proc.c:1.7 src/usr.sbin/rpc.statd/stat_proc.c:1.8
--- src/usr.sbin/rpc.statd/stat_proc.c:1.7 Thu Nov 3 19:36:42 2005
+++ src/usr.sbin/rpc.statd/stat_proc.c Sat Apr 18 13:04:50 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: stat_proc.c,v 1.7 2005/11/03 19:36:42 bouyer Exp $ */
+/* $NetBSD: stat_proc.c,v 1.8 2009/04/18 13:04:50 lukem Exp $ */
/*
* Copyright (c) 1995
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: stat_proc.c,v 1.7 2005/11/03 19:36:42 bouyer Exp $");
+__RCSID("$NetBSD: stat_proc.c,v 1.8 2009/04/18 13:04:50 lukem Exp $");
#endif
#include <errno.h>
@@ -62,7 +62,7 @@
sm_name *arg;
struct svc_req *req;
{
- static sm_stat_res res;
+ static sm_stat_res smres;
struct addrinfo *ai;
NO_ALARM;
@@ -70,17 +70,17 @@
syslog(LOG_DEBUG, "stat called for host %s", arg->mon_name);
if (getaddrinfo(arg->mon_name, NULL, NULL, &ai) == 0) {
- res.res_stat = stat_succ;
+ smres.res_stat = stat_succ;
freeaddrinfo(ai);
} else {
syslog(LOG_ERR, "invalid hostname to sm_stat: %s",
arg->mon_name);
- res.res_stat = stat_fail;
+ smres.res_stat = stat_fail;
}
- res.state = status_info.ourState;
+ smres.state = status_info.ourState;
ALARM;
- return (&res);
+ return (&smres);
}
/* sm_mon_1 ---------------------------------------------------------------- */
@@ -96,7 +96,7 @@
mon *arg;
struct svc_req *req;
{
- static sm_stat_res res;
+ static sm_stat_res smres;
struct addrinfo *ai;
HostInfo *hp, h;
MonList *lp;
@@ -109,8 +109,8 @@
arg->mon_id.my_id.my_name, arg->mon_id.my_id.my_prog,
arg->mon_id.my_id.my_vers, arg->mon_id.my_id.my_proc);
}
- res.res_stat = stat_fail; /* Assume fail until set otherwise */
- res.state = status_info.ourState;
+ smres.res_stat = stat_fail; /* Assume fail until set otherwise */
+ smres.state = status_info.ourState;
/*
* Find existing host entry, or create one if not found. If
@@ -119,7 +119,7 @@
if (getaddrinfo(arg->mon_id.mon_name, NULL, NULL, &ai) != 0) {
syslog(LOG_ERR, "Invalid hostname to sm_mon: %s",
arg->mon_id.mon_name);
- return &res;
+ return &smres;
}
freeaddrinfo(ai);
@@ -143,10 +143,10 @@
hp->monList = lp;
change_host(arg->mon_id.mon_name, hp);
sync_file();
- res.res_stat = stat_succ; /* Report success */
+ smres.res_stat = stat_succ; /* Report success */
}
ALARM;
- return (&res);
+ return (&smres);
}
/* do_unmon ---------------------------------------------------------------- */
@@ -203,7 +203,7 @@
mon_id *arg;
struct svc_req *req;
{
- static sm_stat res;
+ static sm_stat smres;
HostInfo *hp, h;
NO_ALARM;
@@ -227,10 +227,10 @@
syslog(LOG_ERR, "unmon request from %s for unknown host %s",
arg->my_id.my_name, arg->mon_name);
- res.state = status_info.ourState;
+ smres.state = status_info.ourState;
ALARM;
- return (&res);
+ return (&smres);
}
/* sm_unmon_all_1 ---------------------------------------------------------- */
@@ -245,7 +245,7 @@
my_id *arg;
struct svc_req *req;
{
- static sm_stat res;
+ static sm_stat smres;
NO_ALARM;
if (debug) {
@@ -257,10 +257,10 @@
unmon_hosts();
sync_file();
- res.state = status_info.ourState;
+ smres.state = status_info.ourState;
ALARM;
- return (&res);
+ return (&smres);
}
/* sm_simu_crash_1 --------------------------------------------------------- */
Index: src/usr.sbin/rpc.statd/statd.c
diff -u src/usr.sbin/rpc.statd/statd.c:1.28 src/usr.sbin/rpc.statd/statd.c:1.29
--- src/usr.sbin/rpc.statd/statd.c:1.28 Sat Dec 15 19:44:56 2007
+++ src/usr.sbin/rpc.statd/statd.c Sat Apr 18 13:04:50 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: statd.c,v 1.28 2007/12/15 19:44:56 perry Exp $ */
+/* $NetBSD: statd.c,v 1.29 2009/04/18 13:04:50 lukem Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: statd.c,v 1.28 2007/12/15 19:44:56 perry Exp $");
+__RCSID("$NetBSD: statd.c,v 1.29 2009/04/18 13:04:50 lukem Exp $");
#endif
/* main() function for status monitor daemon. Some of the code in this */
@@ -86,8 +86,8 @@
static int check_work __P((DBT *, HostInfo *, void *));
static int unmon_host __P((DBT *, HostInfo *, void *));
static int notify_one __P((DBT *, HostInfo *, void *));
-static void init_file __P((char *));
-static int notify_one_host __P((char *));
+static void init_file __P((const char *));
+static int notify_one_host __P((const char *));
static void die __P((int)) __dead;
int main __P((int, char **));
@@ -518,7 +518,7 @@
*/
static void
init_file(filename)
- char *filename;
+ const char *filename;
{
DBT data;
@@ -586,7 +586,7 @@
static int
notify_one_host(hostname)
- char *hostname;
+ const char *hostname;
{
struct timeval timeout = {20, 0}; /* 20 secs timeout */
CLIENT *cli;