diff options
author | peter <peter@FreeBSD.org> | 1996-12-30 14:43:42 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-12-30 14:43:42 +0000 |
commit | 30d1c281b24cc9a36e9f595aac7cba6fe6f074f6 (patch) | |
tree | dd552f4a8fa9a325c12693e7dd82c983aa4b3362 /lib/libc/rpc/getrpcport.c | |
parent | 2ad3d008149e3d2ce1d9499c67716500e0199649 (diff) | |
download | FreeBSD-src-30d1c281b24cc9a36e9f595aac7cba6fe6f074f6.zip FreeBSD-src-30d1c281b24cc9a36e9f595aac7cba6fe6f074f6.tar.gz |
- missing prototype from include file
- canconical function declaration (ctags safe)
- use standard functions
Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code.
Diffstat (limited to 'lib/libc/rpc/getrpcport.c')
-rw-r--r-- | lib/libc/rpc/getrpcport.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index 91af220..c3e44f1 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)getrpcport.c 1.3 87/08/11 SMI";*/ /*static char *sccsid = "from: @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: getrpcport.c,v 1.4 1996/06/08 22:54:52 jraynard Exp $"; +static char *rcsid = "$Id: getrpcport.c,v 1.5 1996/08/12 14:00:22 peter Exp $"; #endif /* @@ -40,12 +40,12 @@ static char *rcsid = "$Id: getrpcport.c,v 1.4 1996/06/08 22:54:52 jraynard Exp $ #include <stdio.h> #include <string.h> #include <rpc/rpc.h> +#include <rpc/pmap_clnt.h> #include <netdb.h> #include <sys/socket.h> -u_short pmap_getport(struct sockaddr_in *, u_long, u_long, u_int); - -int getrpcport(host, prognum, versnum, proto) +int +getrpcport(host, prognum, versnum, proto) char *host; int prognum, versnum, proto; { @@ -55,9 +55,9 @@ int getrpcport(host, prognum, versnum, proto) if ((hp = gethostbyname(host)) == NULL) return (0); memset(&addr, 0, sizeof(addr)); - bcopy(hp->h_addr, (char *) &addr.sin_addr, hp->h_length); addr.sin_len = sizeof(struct sockaddr_in); addr.sin_family = AF_INET; addr.sin_port = 0; + memcpy((char *)&addr.sin_addr, hp->h_addr, hp->h_length); return (pmap_getport(&addr, prognum, versnum, proto)); } |