Clear up a few warnings (unused variable, rpc versions are usigned so use %u,

rename a parameter to avoid shadowing a global).

MFC after:	1 month
This commit is contained in:
David Malone 2002-09-02 19:58:15 +00:00
parent caefa40062
commit fa11816b52

View File

@ -947,7 +947,6 @@ void
config(void) config(void)
{ {
struct servtab *sep, *new, **sepp; struct servtab *sep, *new, **sepp;
struct conninfo *conn;
long omask; long omask;
int new_nomapped; int new_nomapped;
@ -1719,7 +1718,7 @@ getconfigent(void)
sizeof(sep->se_ctrladdr4)); sizeof(sep->se_ctrladdr4));
if ((versp = rindex(sep->se_service, '/'))) { if ((versp = rindex(sep->se_service, '/'))) {
*versp++ = '\0'; *versp++ = '\0';
switch (sscanf(versp, "%d-%d", switch (sscanf(versp, "%u-%u",
&sep->se_rpc_lowvers, &sep->se_rpc_lowvers,
&sep->se_rpc_highvers)) { &sep->se_rpc_highvers)) {
case 2: case 2:
@ -2436,29 +2435,29 @@ reapchild_conn(pid_t pid)
} }
static void static void
resize_conn(struct servtab *sep, int maxperip) resize_conn(struct servtab *sep, int maxpip)
{ {
struct conninfo *conn; struct conninfo *conn;
int i, j; int i, j;
if (sep->se_maxperip <= 0) if (sep->se_maxperip <= 0)
return; return;
if (maxperip <= 0) { if (maxpip <= 0) {
free_connlist(sep); free_connlist(sep);
return; return;
} }
for (i = 0; i < PERIPSIZE; ++i) { for (i = 0; i < PERIPSIZE; ++i) {
LIST_FOREACH(conn, &sep->se_conn[i], co_link) { LIST_FOREACH(conn, &sep->se_conn[i], co_link) {
for (j = maxperip; j < conn->co_numchild; ++j) for (j = maxpip; j < conn->co_numchild; ++j)
free_proc(conn->co_proc[j]); free_proc(conn->co_proc[j]);
conn->co_proc = realloc(conn->co_proc, conn->co_proc = realloc(conn->co_proc,
maxperip * sizeof(*conn->co_proc)); maxpip * sizeof(*conn->co_proc));
if (conn->co_proc == NULL) { if (conn->co_proc == NULL) {
syslog(LOG_ERR, "realloc: %m"); syslog(LOG_ERR, "realloc: %m");
exit(EX_OSERR); exit(EX_OSERR);
} }
if (conn->co_numchild > maxperip) if (conn->co_numchild > maxpip)
conn->co_numchild = maxperip; conn->co_numchild = maxpip;
} }
} }
} }