summaryrefslogtreecommitdiff
path: root/libc/inet/rpc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-07 07:25:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-07 07:25:57 +0000
commit45f1824dc839fb6401cd6e061924a604438b2bed (patch)
tree541539a86a0ddc1120fec25bcc71774da26f783b /libc/inet/rpc
parentf6fcd28c186a9ff0544e92c32ec61b871aa30b8f (diff)
Kill namespace pollution in getrpcent.c. Silence other rpc warnings
by fixing prototypes. Fix global stuff so it should behave itself properly now, -Erik
Diffstat (limited to 'libc/inet/rpc')
-rw-r--r--libc/inet/rpc/getrpcent.c10
-rw-r--r--libc/inet/rpc/rcmd.c21
-rw-r--r--libc/inet/rpc/rpc_commondata.c5
-rw-r--r--libc/inet/rpc/rpc_thread.c5
4 files changed, 17 insertions, 24 deletions
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index 283c3387e..e290449c0 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -41,11 +41,12 @@
#include <rpc/rpc.h>
#include <netdb.h>
#include <sys/socket.h>
+#include <arpa/inet.h>
/*
* Internet version.
*/
-struct rpcdata {
+static struct rpcdata {
FILE *rpcf;
char *current;
int currentlen;
@@ -58,12 +59,10 @@ struct rpcdata {
} *rpcdata;
static struct rpcent *interpret(const char *val, int len);
-struct hostent *gethostent();
-char *inet_ntoa();
static char RPCDB[] = "/etc/rpc";
-static struct rpcdata *_rpcdata()
+static struct rpcdata *_rpcdata(void)
{
register struct rpcdata *d = rpcdata;
@@ -169,8 +168,7 @@ struct rpcent *getrpcent()
}
#ifdef __linux__
-static char *firstwhite(s)
-char *s;
+static char *firstwhite(char *s)
{
char *s1, *s2;
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index 861ede2d4..de7433d46 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -487,10 +487,7 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
}
/* This is the exported version. */
-int iruserok (raddr, superuser, ruser, luser)
- u_int32_t raddr;
- int superuser;
- const char *ruser, *luser;
+int iruserok (u_int32_t raddr, int superuser, const char * ruser, const char * luser)
{
return iruserok2 (raddr, superuser, ruser, luser, "-");
}
@@ -508,10 +505,7 @@ int iruserok (raddr, superuser, ruser, luser)
* 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)
{
return __ivaliduser2(hostf, raddr, luser, ruser, "-");
}
@@ -519,10 +513,7 @@ __ivaliduser(hostf, raddr, luser, ruser)
/* Returns 1 on positive match, 0 on no match, -1 on negative match. */
static int
-__icheckhost (raddr, lhost, rhost)
- u_int32_t raddr;
- char *lhost;
- const char *rhost;
+__icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
{
struct hostent *hp;
u_int32_t laddr;
@@ -589,8 +580,7 @@ __icheckhost (raddr, lhost, rhost)
/* Returns 1 on positive match, 0 on no match, -1 on negative match. */
static int
-__icheckuser (luser, ruser)
- const char *luser, *ruser;
+__icheckuser (const char *luser, const char *ruser)
{
/*
@@ -623,8 +613,7 @@ __icheckuser (luser, ruser)
* Returns 1 for blank lines (or only comment lines) and 0 otherwise
*/
static int
-__isempty(p)
- char *p;
+__isempty(char *p)
{
while (*p && isspace (*p)) {
++p;
diff --git a/libc/inet/rpc/rpc_commondata.c b/libc/inet/rpc/rpc_commondata.c
index 6b22b3f66..187d915ba 100644
--- a/libc/inet/rpc/rpc_commondata.c
+++ b/libc/inet/rpc/rpc_commondata.c
@@ -27,13 +27,14 @@
* Mountain View, California 94043
*/
#include <rpc/rpc.h>
+#include <sys/poll.h>
+#include <sys/select.h>
-#ifdef _RPC_THREAD_SAFE_
#undef svc_fdset
#undef rpc_createerr
#undef svc_pollfd
#undef svc_max_pollfd
-#endif /* _RPC_THREAD_SAFE_ */
+
/*
* This file should only contain common data (global data) that is exported
diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c
index 267149b62..09bff0dd1 100644
--- a/libc/inet/rpc/rpc_thread.c
+++ b/libc/inet/rpc/rpc_thread.c
@@ -125,6 +125,11 @@ __rpc_thread_svc_max_pollfd (void)
}
#else
+#undef svc_fdset
+#undef rpc_createerr
+#undef svc_pollfd
+#undef svc_max_pollfd
+
fd_set * __rpc_thread_svc_fdset (void)
{
extern fd_set svc_fdset;