bin/71667: [PATCH] cleanup of the usr.sbin/bootparamd code

Bruce Cran bruce at cran.org.uk
Thu Sep 4 22:10:03 UTC 2008


The following reply was made to PR bin/71667; it has been noted by GNATS.

From: Bruce Cran <bruce at cran.org.uk>
To: bug-followup at FreeBSD.org, dan at obluda.cz
Cc:  
Subject: Re: bin/71667: [PATCH] cleanup of the usr.sbin/bootparamd code
Date: Thu, 4 Sep 2008 23:01:35 +0100

 --MP_/kUvXmCHrH.M/W=UT6F4aYvq
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 I have attached a patch which fixes some of the problems with
 bootparamd/bootparamd.c and bootparamd/main.c.   More changes are
 required to bootparamd.c for it to compile with WARNS=6
 though.
 
 -- 
 Bruce Cran
 
 --MP_/kUvXmCHrH.M/W=UT6F4aYvq
 Content-Type: text/x-patch; name=bootparamd.c.diff
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=bootparamd.c.diff
 
 --- bootparamd.c.orig	2008-09-04 21:16:32.000000000 +0100
 +++ bootparamd.c	2008-09-04 22:54:29.000000000 +0100
 @@ -44,12 +44,11 @@
  int checkhost(char *, char *, int);
  
  bp_whoami_res *
 -bootparamproc_whoami_1_svc(whoami, req)
 -bp_whoami_arg *whoami;
 -struct svc_req *req;
 +bootparamproc_whoami_1_svc(bp_whoami_arg *whoami, struct svc_req *req)
  {
    in_addr_t haddr;
    static bp_whoami_res res;
 +  (void) req;
    if (debug)
      fprintf(stderr,"whoami got question for %d.%d.%d.%d\n",
  	    255 &  whoami->client_address.bp_address_u.ip_addr.net,
 @@ -110,13 +109,13 @@
  
  
  bp_getfile_res *
 -  bootparamproc_getfile_1_svc(getfile, req)
 -bp_getfile_arg *getfile;
 -struct svc_req *req;
 +bootparamproc_getfile_1_svc(bp_getfile_arg *getfile, struct svc_req *req)
  {
 -  char *where, *index();
 +  char *where;
    static bp_getfile_res res;
  
 +  (void) req;
 +
    if (debug)
      warnx("getfile got question for \"%s\" and file \"%s\"",
  	    getfile->client_name, getfile->file_id);
 @@ -184,10 +183,7 @@
        empty answer for the file "dump")   */
  
  int
 -getthefile(askname,fileid,buffer,blen)
 -char *askname;
 -char *fileid, *buffer;
 -int blen;
 +getthefile(char *askname,char *fileid,char *buffer,int blen)
  {
    FILE *bpf;
    char  *where;
 @@ -286,10 +282,7 @@
     name for a host in the database */
  
  int
 -checkhost(askname, hostname, len)
 -char *askname;
 -char *hostname;
 -int len;
 +checkhost(char *askname, char *hostname, int len)
  {
    int ch, pch;
    FILE *bpf;
 
 --MP_/kUvXmCHrH.M/W=UT6F4aYvq
 Content-Type: text/x-patch; name=main.c.diff
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=main.c.diff
 
 --- main.c.orig	2008-09-04 21:15:34.000000000 +0100
 +++ main.c	2008-09-04 21:16:23.000000000 +0100
 @@ -36,13 +36,11 @@
  struct sockaddr_in my_addr;
  char *bootpfile = "/etc/bootparams";
  
 -extern  void bootparamprog_1();
 +extern  void bootparamprog_1(void);
  static void usage(void);
  
  int
 -main(argc, argv)
 -int argc;
 -char **argv;
 +main(int argc, char **argv)
  {
  	SVCXPRT *transp;
  	struct hostent *he;
 @@ -107,10 +105,11 @@
  
  	svc_run();
  	errx(1, "svc_run returned");
 +	return 0;
  }
  
  static void
 -usage()
 +usage(void)
  {
  	fprintf(stderr,
  		"usage: bootparamd [-d] [-s] [-r router] [-f bootparmsfile]\n");
 
 --MP_/kUvXmCHrH.M/W=UT6F4aYvq--


More information about the freebsd-bugs mailing list