From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 4 22:10:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36DD1065673 for ; Thu, 4 Sep 2008 22:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B200F8FC18 for ; Thu, 4 Sep 2008 22:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m84MA38D058761 for ; Thu, 4 Sep 2008 22:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m84MA3ZS058760; Thu, 4 Sep 2008 22:10:03 GMT (envelope-from gnats) Date: Thu, 4 Sep 2008 22:10:03 GMT Message-Id: <200809042210.m84MA3ZS058760@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Cran Cc: Subject: Re: bin/71667: [PATCH] cleanup of the usr.sbin/bootparamd code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce Cran List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 22:10:03 -0000 The following reply was made to PR bin/71667; it has been noted by GNATS. From: Bruce Cran To: bug-followup@FreeBSD.org, dan@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--