Page MenuHomeFreeBSD

D39521.id120587.diff
No OneTemporary

D39521.id120587.diff

diff --git a/libexec/rpc.rstatd/rstat_proc.c b/libexec/rpc.rstatd/rstat_proc.c
--- a/libexec/rpc.rstatd/rstat_proc.c
+++ b/libexec/rpc.rstatd/rstat_proc.c
@@ -406,9 +406,10 @@
union {
int fill;
} argument;
- char *result;
- bool_t (*xdr_argument)(), (*xdr_result)();
- char *(*local)();
+ void *result;
+ xdrproc_t xdr_argument, xdr_result;
+ typedef void *(svc_cb)(void *arg, struct svc_req *rqstp);
+ svc_cb *local;
switch (rqstp->rq_proc) {
case NULLPROC:
@@ -416,17 +417,17 @@
goto leave;
case RSTATPROC_STATS:
- xdr_argument = xdr_void;
- xdr_result = xdr_statstime;
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_statstime;
switch (rqstp->rq_vers) {
case RSTATVERS_ORIG:
- local = (char *(*)()) rstatproc_stats_1_svc;
+ local = (svc_cb *)rstatproc_stats_1_svc;
break;
case RSTATVERS_SWTCH:
- local = (char *(*)()) rstatproc_stats_2_svc;
+ local = (svc_cb *)rstatproc_stats_2_svc;
break;
case RSTATVERS_TIME:
- local = (char *(*)()) rstatproc_stats_3_svc;
+ local = (svc_cb *)rstatproc_stats_3_svc;
break;
default:
svcerr_progvers(transp, RSTATVERS_ORIG, RSTATVERS_TIME);
@@ -436,17 +437,17 @@
break;
case RSTATPROC_HAVEDISK:
- xdr_argument = xdr_void;
- xdr_result = xdr_u_int;
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_u_int;
switch (rqstp->rq_vers) {
case RSTATVERS_ORIG:
- local = (char *(*)()) rstatproc_havedisk_1_svc;
+ local = (svc_cb *)rstatproc_havedisk_1_svc;
break;
case RSTATVERS_SWTCH:
- local = (char *(*)()) rstatproc_havedisk_2_svc;
+ local = (svc_cb *)rstatproc_havedisk_2_svc;
break;
case RSTATVERS_TIME:
- local = (char *(*)()) rstatproc_havedisk_3_svc;
+ local = (svc_cb *)rstatproc_havedisk_3_svc;
break;
default:
svcerr_progvers(transp, RSTATVERS_ORIG, RSTATVERS_TIME);
@@ -460,16 +461,16 @@
goto leave;
}
bzero((char *)&argument, sizeof(argument));
- if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
+ if (!svc_getargs(transp, xdr_argument, &argument)) {
svcerr_decode(transp);
goto leave;
}
result = (*local)(&argument, rqstp);
if (result != NULL &&
- !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
+ !svc_sendreply(transp, xdr_result, result)) {
svcerr_systemerr(transp);
}
- if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, &argument))
+ if (!svc_freeargs(transp, xdr_argument, &argument))
errx(1, "unable to free arguments");
leave:
if (from_inetd)
diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c
--- a/libexec/rpc.rwalld/rwalld.c
+++ b/libexec/rpc.rwalld/rwalld.c
@@ -167,9 +167,10 @@
union {
char *wallproc_wall_1_arg;
} argument;
- char *result;
- bool_t (*xdr_argument)(), (*xdr_result)();
- char *(*local)();
+ void *result;
+ xdrproc_t xdr_argument, xdr_result;
+ typedef void *(svc_cb)(void *arg, struct svc_req *rqstp);
+ svc_cb *local;
switch (rqstp->rq_proc) {
case NULLPROC:
@@ -177,9 +178,9 @@
goto leave;
case WALLPROC_WALL:
- xdr_argument = xdr_wrapstring;
- xdr_result = xdr_void;
- local = (char *(*)()) wallproc_wall_1_svc;
+ xdr_argument = (xdrproc_t)xdr_wrapstring;
+ xdr_result = (xdrproc_t)xdr_void;
+ local = (svc_cb *)wallproc_wall_1_svc;
break;
default:
@@ -187,16 +188,16 @@
goto leave;
}
bzero(&argument, sizeof(argument));
- if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
+ if (!svc_getargs(transp, xdr_argument, &argument)) {
svcerr_decode(transp);
goto leave;
}
result = (*local)(&argument, rqstp);
if (result != NULL &&
- !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
+ !svc_sendreply(transp, xdr_result, result)) {
svcerr_systemerr(transp);
}
- if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, &argument)) {
+ if (!svc_freeargs(transp, xdr_argument, &argument)) {
syslog(LOG_ERR, "unable to free arguments");
exit(1);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 2:12 AM (2 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14476189
Default Alt Text
D39521.id120587.diff (4 KB)

Event Timeline