summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2015-09-20 21:21:17 +0000
committerrodrigc <rodrigc@FreeBSD.org>2015-09-20 21:21:17 +0000
commit6e42fc823f517f7e299a40b021d3ede6cc278a6b (patch)
tree3f5ea7ea488212c1d5afaaf352b71917dd4c85bc /lib/libc
parent4dfb6c3572b83ea3e8bebf716589664f3f9067dd (diff)
downloadFreeBSD-src-6e42fc823f517f7e299a40b021d3ede6cc278a6b.zip
FreeBSD-src-6e42fc823f517f7e299a40b021d3ede6cc278a6b.tar.gz
Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/rcmd.c61
1 files changed, 16 insertions, 45 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 1ba9888..c7ca870 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -73,22 +73,15 @@ static int __icheckhost(const struct sockaddr *, socklen_t, const char *);
char paddr[NI_MAXHOST];
int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
+rcmd(char **ahost, int rport, const char *locuser, const char *remuser,
+ const char *cmd, int *fd2p)
{
return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET);
}
int
-rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
- int af;
+rcmd_af(char **ahost, int rport, const char *locuser, const char *remuser,
+ const char *cmd, int *fd2p, int af)
{
struct addrinfo hints, *res, *ai;
struct sockaddr_storage from;
@@ -321,15 +314,13 @@ bad:
}
int
-rresvport(port)
- int *port;
+rresvport(int *port)
{
return rresvport_af(port, AF_INET);
}
int
-rresvport_af(alport, family)
- int *alport, family;
+rresvport_af(int *alport, int family)
{
int s;
struct sockaddr_storage ss;
@@ -380,9 +371,7 @@ int __check_rhosts_file = 1;
char *__rcmd_errstr;
int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
+ruserok(const char *rhost, int superuser, const char *ruser, const char *luser)
{
struct addrinfo hints, *res, *r;
int error;
@@ -415,10 +404,7 @@ ruserok(rhost, superuser, ruser, luser)
* Returns 0 if ok, -1 if not ok.
*/
int
-iruserok(raddr, superuser, ruser, luser)
- unsigned long raddr;
- int superuser;
- const char *ruser, *luser;
+iruserok(unsigned long raddr, int superuser, const char *ruser, const char *luser)
{
struct sockaddr_in sin;
@@ -436,11 +422,8 @@ iruserok(raddr, superuser, ruser, luser)
* Returns 0 if ok, -1 if not ok.
*/
int
-iruserok_sa(ra, rlen, superuser, ruser, luser)
- const void *ra;
- int rlen;
- int superuser;
- const char *ruser, *luser;
+iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser,
+ const char *luser)
{
char *cp;
struct stat sbuf;
@@ -520,10 +503,7 @@ again:
* Returns 0 if ok, -1 if not ok.
*/
int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_int32_t raddr;
- const char *luser, *ruser;
+__ivaliduser(FILE *hostf, u_int32_t raddr, const char *luser, const char *ruser)
{
struct sockaddr_in sin;
@@ -541,11 +521,8 @@ __ivaliduser(hostf, raddr, luser, ruser)
* XXX obsolete API.
*/
int
-__ivaliduser_af(hostf, raddr, luser, ruser, af, len)
- FILE *hostf;
- const void *raddr;
- const char *luser, *ruser;
- int af, len;
+__ivaliduser_af(FILE *hostf, const void *raddr, const char *luser,
+ const char *ruser, int af, int len)
{
struct sockaddr *sa = NULL;
struct sockaddr_in *sin = NULL;
@@ -584,11 +561,8 @@ __ivaliduser_af(hostf, raddr, luser, ruser, af, len)
}
int
-__ivaliduser_sa(hostf, raddr, salen, luser, ruser)
- FILE *hostf;
- const struct sockaddr *raddr;
- socklen_t salen;
- const char *luser, *ruser;
+__ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, socklen_t salen,
+ const char *luser, const char *ruser)
{
char *user, *p;
int ch;
@@ -707,10 +681,7 @@ __ivaliduser_sa(hostf, raddr, salen, luser, ruser)
* Returns "true" if match, 0 if no match.
*/
static int
-__icheckhost(raddr, salen, lhost)
- const struct sockaddr *raddr;
- socklen_t salen;
- const char *lhost;
+__icheckhost(const struct sockaddr *raddr, socklen_t salen, const char *lhost)
{
struct sockaddr_in sin;
struct sockaddr_in6 *sin6;
OpenPOWER on IntegriCloud