Make this compile cleanly. It passes WARNS=2, but I haven't checked

it is so on more platforms.
This commit is contained in:
peter 2003-10-26 06:10:44 +00:00
parent 39da8f45bd
commit edafc1a965
5 changed files with 44 additions and 29 deletions

View File

@ -7,6 +7,7 @@ MLINKS= rpc.lockd.8 lockd.8
SRCS= kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc
#WARNS?= 2
DPADD= ${LIBRPCSVC} ${LIBUTIL}
LDADD= -lrpcsvc -lutil

View File

@ -291,7 +291,8 @@ test_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_TEST_MSG,
xdr_nlm4_testargs, &arg4, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm4_testargs, &arg4,
(xdrproc_t)xdr_void, &dummy, timeout);
} else {
struct nlm_testargs arg;
@ -314,7 +315,8 @@ test_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_TEST_MSG,
xdr_nlm_testargs, &arg, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm_testargs, &arg,
(xdrproc_t)xdr_void, &dummy, timeout);
}
return (0);
}
@ -361,7 +363,8 @@ lock_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_LOCK_MSG,
xdr_nlm4_lockargs, &arg4, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm4_lockargs, &arg4,
(xdrproc_t)xdr_void, &dummy, timeout);
} else {
arg.cookie.n_bytes = (char *)&msg->lm_msg_ident;
arg.cookie.n_len = sizeof(msg->lm_msg_ident);
@ -385,7 +388,8 @@ lock_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_LOCK_MSG,
xdr_nlm_lockargs, &arg, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm_lockargs, &arg,
(xdrproc_t)xdr_void, &dummy, timeout);
}
return (0);
}
@ -427,7 +431,8 @@ unlock_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_UNLOCK_MSG,
xdr_nlm4_unlockargs, &arg4, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm4_unlockargs, &arg4,
(xdrproc_t)xdr_void, &dummy, timeout);
} else {
arg.cookie.n_bytes = (char *)&msg->lm_msg_ident;
arg.cookie.n_len = sizeof(msg->lm_msg_ident);
@ -447,7 +452,8 @@ unlock_request(LOCKD_MSG *msg)
set_auth(cli, &msg->lm_cred);
(void)clnt_call(cli, NLM_UNLOCK_MSG,
xdr_nlm_unlockargs, &arg, xdr_void, &dummy, timeout);
(xdrproc_t)xdr_nlm_unlockargs, &arg,
(xdrproc_t)xdr_void, &dummy, timeout);
}
return (0);
@ -588,11 +594,12 @@ show(LOCKD_MSG *mp)
}
*t = '\0';
syslog(LOG_DEBUG, "fh_len %d, fh %s\n", mp->lm_fh_len, buf);
syslog(LOG_DEBUG, "fh_len %d, fh %s\n", (int)mp->lm_fh_len, buf);
/* Show flock structure. */
syslog(LOG_DEBUG, "start %qu; len %qu; pid %lu; type %d; whence %d\n",
mp->lm_fl.l_start, mp->lm_fl.l_len, (u_long)mp->lm_fl.l_pid,
(unsigned long long)mp->lm_fl.l_start,
(unsigned long long)mp->lm_fl.l_len, (u_long)mp->lm_fl.l_pid,
mp->lm_fl.l_type, mp->lm_fl.l_whence);
/* Show wait flag. */

View File

@ -318,8 +318,8 @@ transmit_result(opcode, result, addr)
timeo.tv_sec = 0; /* No timeout - not expecting response */
timeo.tv_usec = 0;
success = clnt_call(cli, opcode, xdr_nlm_res, result, xdr_void,
&dummy, timeo);
success = clnt_call(cli, opcode, (xdrproc_t)xdr_nlm_res, result,
(xdrproc_t)xdr_void, &dummy, timeo);
if (debug_level > 2)
syslog(LOG_DEBUG, "clnt_call returns %d(%s)",
@ -349,8 +349,9 @@ transmit4_result(opcode, result, addr)
timeo.tv_sec = 0; /* No timeout - not expecting response */
timeo.tv_usec = 0;
success = clnt_call(cli, opcode, xdr_nlm4_res, result, xdr_void,
&dummy, timeo);
success = clnt_call(cli, opcode,
(xdrproc_t)xdr_nlm4_res, result,
(xdrproc_t)xdr_void, &dummy, timeo);
if (debug_level > 2)
syslog(LOG_DEBUG, "clnt_call returns %d(%s)",
@ -479,8 +480,9 @@ nlm_test_msg_1_svc(arg, rqstp)
timeo.tv_sec = 0; /* No timeout - not expecting response */
timeo.tv_usec = 0;
success = clnt_call(cli, NLM_TEST_RES, xdr_nlm_testres,
&res, xdr_void, &dummy, timeo);
success = clnt_call(cli, NLM_TEST_RES,
(xdrproc_t)xdr_nlm_testres, &res,
(xdrproc_t)xdr_void, &dummy, timeo);
if (debug_level > 2)
syslog(LOG_DEBUG, "clnt_call returns %d", success);
@ -979,8 +981,9 @@ nlm4_test_msg_4_svc(arg, rqstp)
timeo.tv_sec = 0; /* No timeout - not expecting response */
timeo.tv_usec = 0;
success = clnt_call(cli, NLM4_TEST_RES, xdr_nlm4_testres,
&res, xdr_void, &dummy, timeo);
success = clnt_call(cli, NLM4_TEST_RES,
(xdrproc_t)xdr_nlm4_testres, &res,
(xdrproc_t)xdr_void, &dummy, timeo);
if (debug_level > 2)
syslog(LOG_DEBUG, "clnt_call returns %d", success);

View File

@ -253,7 +253,7 @@ init_nsm(void)
*/
do {
ret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON_ALL,
xdr_my_id, &id, xdr_sm_stat, &stat);
(xdrproc_t)xdr_my_id, &id, (xdrproc_t)xdr_sm_stat, &stat);
if (ret == RPC_PROGUNAVAIL) {
syslog(LOG_WARNING, "%lu %s", SM_PROG,
clnt_sperrno(ret));

View File

@ -160,7 +160,7 @@ void send_granted(struct file_lock *fl, int opcode);
void siglock(void);
void sigunlock(void);
void monitor_lock_host(const char *hostname);
void unmonitor_lock_host(const char *hostname);
void unmonitor_lock_host(char *hostname);
void copy_nlm4_lock_to_nlm4_holder(const struct nlm4_lock *src,
const bool_t exclusive, struct nlm4_holder *dest);
@ -2027,8 +2027,9 @@ monitor_lock_host(const char *hostname)
smon.mon_id.my_id.my_vers = NLM_SM;
smon.mon_id.my_id.my_proc = NLM_SM_NOTIFY;
rpcret = callrpc("localhost", SM_PROG, SM_VERS, SM_MON, xdr_mon,
&smon, xdr_sm_stat_res, &sres);
rpcret = callrpc("localhost", SM_PROG, SM_VERS, SM_MON,
(xdrproc_t)xdr_mon, &smon,
(xdrproc_t)xdr_sm_stat_res, &sres);
if (rpcret == 0) {
if (sres.res_stat == stat_fail) {
@ -2055,7 +2056,7 @@ monitor_lock_host(const char *hostname)
* unmonitor_lock_host: clear monitor ref counts and inform statd when gone
*/
void
unmonitor_lock_host(const char *hostname)
unmonitor_lock_host(char *hostname)
{
struct host *ihp;
struct mon_id smon_id;
@ -2097,8 +2098,9 @@ unmonitor_lock_host(const char *hostname)
smon_id.my_id.my_vers = NLM_SM;
smon_id.my_id.my_proc = NLM_SM_NOTIFY;
rpcret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON, xdr_mon,
&smon_id, xdr_sm_stat_res, &smstat);
rpcret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON,
(xdrproc_t)xdr_mon, &smon_id,
(xdrproc_t)xdr_sm_stat_res, &smstat);
if (rpcret != 0) {
debuglog("Rpc call to unmonitor statd failed with "
@ -2183,11 +2185,12 @@ send_granted(fl, opcode)
(fl->flags & LOCK_ASYNC) ? " (async)":"");
if (fl->flags & LOCK_ASYNC) {
success = clnt_call(cli, NLM4_GRANTED_MSG,
xdr_nlm4_testargs, &res, xdr_void, &dummy, timeo);
(xdrproc_t)xdr_nlm4_testargs, &res,
(xdrproc_t)xdr_void, &dummy, timeo);
} else {
success = clnt_call(cli, NLM4_GRANTED,
xdr_nlm4_testargs, &res, xdr_nlm4_res,
&retval4, timeo);
(xdrproc_t)xdr_nlm4_testargs, &res,
(xdrproc_t)xdr_nlm4_res, &retval4, timeo);
}
} else {
static nlm_testargs res;
@ -2205,11 +2208,12 @@ send_granted(fl, opcode)
(fl->flags & LOCK_ASYNC) ? " (async)":"");
if (fl->flags & LOCK_ASYNC) {
success = clnt_call(cli, NLM_GRANTED_MSG,
xdr_nlm_testargs, &res, xdr_void, &dummy, timeo);
(xdrproc_t)xdr_nlm_testargs, &res,
(xdrproc_t)xdr_void, &dummy, timeo);
} else {
success = clnt_call(cli, NLM_GRANTED,
xdr_nlm_testargs, &res, xdr_nlm_res,
&retval, timeo);
(xdrproc_t)xdr_nlm_testargs, &res,
(xdrproc_t)xdr_nlm_res, &retval, timeo);
}
}
if (debug_level > 2)