diff options
author | des <des@FreeBSD.org> | 2009-09-26 23:25:22 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2009-09-26 23:25:22 +0000 |
commit | ca7f5e11bd77d20275db4266c3010470050c8a09 (patch) | |
tree | 651271fc4ef4755d0023a49c0657fa23feaaf787 /libexec/rpc.rquotad | |
parent | a45436ee4714833a11bf829d86620ac727a0d501 (diff) | |
parent | 6079decb9019311024359a5172992bb972921e9d (diff) | |
download | FreeBSD-src-ca7f5e11bd77d20275db4266c3010470050c8a09.zip FreeBSD-src-ca7f5e11bd77d20275db4266c3010470050c8a09.tar.gz |
Sync from head.
Diffstat (limited to 'libexec/rpc.rquotad')
-rw-r--r-- | libexec/rpc.rquotad/rquotad.c | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c index 5be6ce1..a2fe04e 100644 --- a/libexec/rpc.rquotad/rquotad.c +++ b/libexec/rpc.rquotad/rquotad.c @@ -32,12 +32,11 @@ __FBSDID("$FreeBSD$"); #include <syslog.h> #include <unistd.h> -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 @@ -49,9 +48,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) @@ -112,7 +111,7 @@ main(void) exit(1); } -void +static void rquota_service(struct svc_req *request, SVCXPRT *transp) { @@ -135,7 +134,7 @@ rquota_service(struct svc_req *request, SVCXPRT *transp) } /* read quota for the specified id, and send it */ -void +static void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -184,26 +183,8 @@ sendquota(struct svc_req *request, SVCXPRT *transp) } } -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; @@ -241,7 +222,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 quotafile *qf; @@ -281,7 +262,7 @@ getfsquota(long id, char *path, struct dqblk *dqblk) * 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]; |