summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bootparamd
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2003-06-20 04:54:27 +0000
committerjmg <jmg@FreeBSD.org>2003-06-20 04:54:27 +0000
commit28f550b7a0423aaf0d3f90b3dccc6080dfef09c0 (patch)
tree2383c5c1b804d700fb2dbfcec2c5db6cd9900672 /usr.sbin/bootparamd
parent9a0cfab67f02bd4d4f45d4a48f1fea1a58c0cddf (diff)
downloadFreeBSD-src-28f550b7a0423aaf0d3f90b3dccc6080dfef09c0.zip
FreeBSD-src-28f550b7a0423aaf0d3f90b3dccc6080dfef09c0.tar.gz
fix problem with uninitalized ptr (from PR)
other minor clean up. PR: bin/2785 Submitted by: mpp
Diffstat (limited to 'usr.sbin/bootparamd')
-rw-r--r--usr.sbin/bootparamd/callbootd/callbootd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/usr.sbin/bootparamd/callbootd/callbootd.c b/usr.sbin/bootparamd/callbootd/callbootd.c
index b7827ac..5ed4608 100644
--- a/usr.sbin/bootparamd/callbootd/callbootd.c
+++ b/usr.sbin/bootparamd/callbootd/callbootd.c
@@ -20,6 +20,7 @@ static const char rcsid[] =
#include <arpa/inet.h>
#include <err.h>
#include <netdb.h>
+#include <stdlib.h>
/* #define bp_address_u bp_address */
@@ -36,7 +37,7 @@ static void usage __P((void));
int printgetfile __P((bp_getfile_res *));
int printwhoami __P((bp_whoami_res *));
-int
+bool_t
eachres_whoami(resultp, raddr)
bp_whoami_res *resultp;
struct sockaddr_in *raddr;
@@ -50,6 +51,7 @@ struct sockaddr_in *raddr;
return(0);
}
+bool_t
eachres_getfile(resultp, raddr)
bp_getfile_res *resultp;
struct sockaddr_in *raddr;
@@ -95,11 +97,10 @@ char **argv;
if ( ! broadcast ) {
clnt = clnt_create(server,BOOTPARAMPROG, BOOTPARAMVERS, "udp");
+ if ( clnt == NULL )
+ errx(1, "could not contact bootparam server on host %s", server);
}
- if ( clnt == NULL )
- errx(1, "could not contact bootparam server on host %s", server);
-
switch (argc) {
case 3:
whoami_arg.client_address.address_type = IP_ADDR_TYPE;
@@ -118,8 +119,10 @@ char **argv;
} else {
clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
BOOTPARAMPROC_WHOAMI,
- (xdrproc_t)xdr_bp_whoami_arg, (char *)&whoami_arg,
- xdr_bp_whoami_res, (char *)&stat_whoami_res,
+ (xdrproc_t)xdr_bp_whoami_arg,
+ (char *)&whoami_arg,
+ (xdrproc_t)xdr_bp_whoami_res,
+ (char *)&stat_whoami_res,
(resultproc_t)eachres_whoami);
exit(0);
}
@@ -139,8 +142,10 @@ char **argv;
} else {
clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
BOOTPARAMPROC_GETFILE,
- xdr_bp_getfile_arg, (char *)&getfile_arg,
- xdr_bp_getfile_res, (char *)&stat_getfile_res,
+ (xdrproc_t)xdr_bp_getfile_arg,
+ (char *)&getfile_arg,
+ (xdrproc_t)xdr_bp_getfile_res,
+ (char *)&stat_getfile_res,
(resultproc_t)eachres_getfile);
exit(0);
}
OpenPOWER on IntegriCloud