From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 23:05:01 2009 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 82B60106566C; Sat, 26 Sep 2009 23:05:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 672798FC0C; Sat, 26 Sep 2009 23:05:01 +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 n8QN511n073248; Sat, 26 Sep 2009 23:05:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QN51Yj073246; Sat, 26 Sep 2009 23:05:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909262305.n8QN51Yj073246@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 Sep 2009 23:05:01 +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: r197531 - head/libexec/rpc.rquotad 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: Sat, 26 Sep 2009 23:05:01 -0000 Author: des Date: Sat Sep 26 23:05:01 2009 New Revision: 197531 URL: http://svn.freebsd.org/changeset/base/197531 Log: printerr_reply() has never been used for as long as we've had this code in our tree (13+ years). This is an excellent argument for aggressive use of "static". Modified: head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Sat Sep 26 20:43:00 2009 (r197530) +++ head/libexec/rpc.rquotad/rquotad.c Sat Sep 26 23:05:01 2009 (r197531) @@ -31,12 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include -void rquota_service(struct svc_req *request, SVCXPRT *transp); -void sendquota(struct svc_req *request, SVCXPRT *transp); -void printerr_reply(SVCXPRT *transp); -void initfs(void); -int getfsquota(long id, char *path, struct dqblk *dqblk); -int hasquota(struct fstab *fs, char **qfnamep); +static void rquota_service(struct svc_req *request, SVCXPRT *transp); +static void sendquota(struct svc_req *request, SVCXPRT *transp); +static void initfs(void); +static int getfsquota(long id, char *path, struct dqblk *dqblk); +static int hasquota(struct fstab *fs, char **qfnamep); /* * structure containing informations about ufs filesystems @@ -48,9 +47,9 @@ struct fs_stat { char *qfpathname; /* pathname of the quota file */ dev_t st_dev; /* device of the filesystem */ } fs_stat; -struct fs_stat *fs_begin = NULL; +static struct fs_stat *fs_begin = NULL; -int from_inetd = 1; +static int from_inetd = 1; static void cleanup(int sig) @@ -111,7 +110,7 @@ main(void) exit(1); } -void +static void rquota_service(struct svc_req *request, SVCXPRT *transp) { @@ -134,7 +133,7 @@ rquota_service(struct svc_req *request, } /* read quota for the specified id, and send it */ -void +static void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -183,26 +182,8 @@ sendquota(struct svc_req *request, SVCXP } } -void -printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */ -{ - char name[INET6_ADDRSTRLEN]; - struct sockaddr *caller; - int save_errno; - - save_errno = errno; - caller = (struct sockaddr *)svc_getrpccaller(transp)->buf; - getnameinfo(caller, caller->sa_len, name, sizeof (name), - NULL, 0, NI_NUMERICHOST); - errno = save_errno; - if (errno == 0) - syslog(LOG_ERR, "couldn't send reply to %s", name); - else - syslog(LOG_ERR, "couldn't send reply to %s: %m", name); -} - /* initialise the fs_tab list from entries in /etc/fstab */ -void +static void initfs(void) { struct fs_stat *fs_current = NULL; @@ -240,7 +221,7 @@ initfs(void) * gets the quotas for id, filesystem path. * Return 0 if fail, 1 otherwise */ -int +static int getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; @@ -295,7 +276,7 @@ getfsquota(long id, char *path, struct d * Check to see if a particular quota is to be enabled. * Comes from quota.c, NetBSD 0.9 */ -int +static int hasquota(struct fstab *fs, char **qfnamep) { static char initname, usrname[100];