From owner-svn-src-all@FreeBSD.ORG Mon Dec 20 09:28:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A717D106564A; Mon, 20 Dec 2010 09:28:28 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 944DE8FC1A; Mon, 20 Dec 2010 09:28:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBK9SSYh033354; Mon, 20 Dec 2010 09:28:28 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBK9SSdY033352; Mon, 20 Dec 2010 09:28:28 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201012200928.oBK9SSdY033352@svn.freebsd.org> From: Philippe Charnier Date: Mon, 20 Dec 2010 09:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216587 - head/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2010 09:28:28 -0000 Author: charnier Date: Mon Dec 20 09:28:28 2010 New Revision: 216587 URL: http://svn.freebsd.org/changeset/base/216587 Log: Add __unused. Ansi prototypes. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Dec 20 08:54:30 2010 (r216586) +++ head/usr.sbin/mountd/mountd.c Mon Dec 20 09:28:28 2010 (r216587) @@ -196,6 +196,7 @@ void mntsrv(struct svc_req *, SVCXPRT *) void nextfield(char **, char **); void out_of_mem(void); void parsecred(char *, struct xucred *); +int parsesec(char *, struct exportlist *); int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *, int); void *sa_rawaddr(struct sockaddr *sa, int *nbytes); int sacmp(struct sockaddr *sa1, struct sockaddr *sa2, @@ -205,6 +206,7 @@ static void usage(void); int xdr_dir(XDR *, char *); int xdr_explist(XDR *, caddr_t); int xdr_explist_brief(XDR *, caddr_t); +int xdr_explist_common(XDR *, caddr_t, int); int xdr_fhs(XDR *, caddr_t); int xdr_mlist(XDR *, caddr_t); void terminate(int); @@ -269,9 +271,7 @@ int debug = 0; * and "-n" to allow nonroot mount. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { fd_set readfds; struct netconfig *nconf; @@ -729,7 +729,7 @@ create_service(struct netconfig *nconf) } static void -usage() +usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " @@ -741,9 +741,7 @@ usage() * The mount rpc service */ void -mntsrv(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +mntsrv(struct svc_req *rqstp, SVCXPRT *transp) { struct exportlist *ep; struct dirlist *dp; @@ -949,9 +947,7 @@ mntsrv(rqstp, transp) * Xdr conversion for a dirpath string */ int -xdr_dir(xdrsp, dirp) - XDR *xdrsp; - char *dirp; +xdr_dir(XDR *xdrsp, char *dirp) { return (xdr_string(xdrsp, &dirp, MNTPATHLEN)); } @@ -960,9 +956,7 @@ xdr_dir(xdrsp, dirp) * Xdr routine to generate file handle reply */ int -xdr_fhs(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_fhs(XDR *xdrsp, caddr_t cp) { struct fhreturn *fhrp = (struct fhreturn *)cp; u_long ok = 0, len, auth; @@ -998,9 +992,7 @@ xdr_fhs(xdrsp, cp) } int -xdr_mlist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_mlist(XDR *xdrsp, caddr_t cp __unused) { struct mountlist *mlp; int true = 1; @@ -1028,10 +1020,7 @@ xdr_mlist(xdrsp, cp) * Xdr conversion for export list */ int -xdr_explist_common(xdrsp, cp, brief) - XDR *xdrsp; - caddr_t cp; - int brief; +xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief) { struct exportlist *ep; int false = 0; @@ -1067,12 +1056,8 @@ errout: * directory paths. */ int -put_exlist(dp, xdrsp, adp, putdefp, brief) - struct dirlist *dp; - XDR *xdrsp; - struct dirlist *adp; - int *putdefp; - int brief; +put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp, + int brief) { struct grouplist *grp; struct hostlist *hp; @@ -1135,18 +1120,14 @@ put_exlist(dp, xdrsp, adp, putdefp, brie } int -xdr_explist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_explist(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 0); } int -xdr_explist_brief(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_explist_brief(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 1); @@ -1160,7 +1141,7 @@ FILE *exp_file; * Get the export list from one, currently open file */ static void -get_exportlist_one() +get_exportlist_one(void) { struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; @@ -1470,7 +1451,7 @@ nextline: * Get the export list from all specified files */ void -get_exportlist() +get_exportlist(void) { struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; @@ -1621,7 +1602,7 @@ get_exportlist() * Allocate an export list element */ struct exportlist * -get_exp() +get_exp(void) { struct exportlist *ep; @@ -1636,7 +1617,7 @@ get_exp() * Allocate a group list element */ struct grouplist * -get_grp() +get_grp(void) { struct grouplist *gp; @@ -1651,9 +1632,7 @@ get_grp() * Clean up upon an error in get_exportlist(). */ void -getexp_err(ep, grp) - struct exportlist *ep; - struct grouplist *grp; +getexp_err(struct exportlist *ep, struct grouplist *grp) { struct grouplist *tgrp; @@ -1672,8 +1651,7 @@ getexp_err(ep, grp) * Search the export list for a matching fs. */ struct exportlist * -ex_search(fsid) - fsid_t *fsid; +ex_search(fsid_t *fsid) { struct exportlist *ep; @@ -1691,10 +1669,7 @@ ex_search(fsid) * Add a directory path to the list. */ char * -add_expdir(dpp, cp, len) - struct dirlist **dpp; - char *cp; - int len; +add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; @@ -1715,11 +1690,8 @@ add_expdir(dpp, cp, len) * and update the entry for host. */ void -hang_dirp(dp, grp, ep, flags) - struct dirlist *dp; - struct grouplist *grp; - struct exportlist *ep; - int flags; +hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, + int flags) { struct hostlist *hp; struct dirlist *dp2; @@ -1756,11 +1728,8 @@ hang_dirp(dp, grp, ep, flags) * for the new directory or adding the new node. */ void -add_dlist(dpp, newdp, grp, flags) - struct dirlist **dpp; - struct dirlist *newdp; - struct grouplist *grp; - int flags; +add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, + int flags) { struct dirlist *dp; struct hostlist *hp; @@ -1803,9 +1772,7 @@ add_dlist(dpp, newdp, grp, flags) * Search for a dirpath on the export point. */ struct dirlist * -dirp_search(dp, dirp) - struct dirlist *dp; - char *dirp; +dirp_search(struct dirlist *dp, char *dirp) { int cmp; @@ -1825,11 +1792,8 @@ dirp_search(dp, dirp) * Scan for a host match in a directory tree. */ int -chk_host(dp, saddr, defsetp, hostsetp) - struct dirlist *dp; - struct sockaddr *saddr; - int *defsetp; - int *hostsetp; +chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp, + int *hostsetp) { struct hostlist *hp; struct grouplist *grp; @@ -1872,9 +1836,7 @@ chk_host(dp, saddr, defsetp, hostsetp) * Scan tree for a host that matches the address. */ int -scan_tree(dp, saddr) - struct dirlist *dp; - struct sockaddr *saddr; +scan_tree(struct dirlist *dp, struct sockaddr *saddr) { int defset, hostset; @@ -1893,8 +1855,7 @@ scan_tree(dp, saddr) * Traverse the dirlist tree and free it up. */ void -free_dir(dp) - struct dirlist *dp; +free_dir(struct dirlist *dp) { if (dp) { @@ -1909,9 +1870,7 @@ free_dir(dp) * Parse a colon separated list of security flavors */ int -parsesec(seclist, ep) - char *seclist; - struct exportlist *ep; +parsesec(char *seclist, struct exportlist *ep) { char *cp, savedc; int flavor; @@ -1962,13 +1921,8 @@ parsesec(seclist, ep) * -