diff options
author | Philippe Charnier <charnier@FreeBSD.org> | 1997-10-09 07:17:36 +0000 |
---|---|---|
committer | Philippe Charnier <charnier@FreeBSD.org> | 1997-10-09 07:17:36 +0000 |
commit | 4a9670dd7611f7099912f5326cadb5cdc64393c0 (patch) | |
tree | 14bbc7ebec0eafaf55a14663a65033ecff46983e /usr.sbin/portmap/pmap_set | |
parent | a624e84fff4bac9c001947c7d6c2c64294b0421d (diff) | |
download | src-4a9670dd7611f7099912f5326cadb5cdc64393c0.tar.gz src-4a9670dd7611f7099912f5326cadb5cdc64393c0.zip |
Use err(3). Add usage().
Correct the .Nd string: in real life, portmap is translating rpc prog numbers
to darpa ports, not the opposite.
Notes
Notes:
svn path=/head/; revision=30242
Diffstat (limited to 'usr.sbin/portmap/pmap_set')
-rw-r--r-- | usr.sbin/portmap/pmap_set/pmap_set.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/portmap/pmap_set/pmap_set.c b/usr.sbin/portmap/pmap_set/pmap_set.c index 92e79942bda4..3ba94fc5325c 100644 --- a/usr.sbin/portmap/pmap_set/pmap_set.c +++ b/usr.sbin/portmap/pmap_set/pmap_set.c @@ -6,9 +6,14 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#) pmap_set.c 1.1 92/06/11 22:53:16"; #endif +static const char rcsid[] = + "$Id$"; +#endif +#include <err.h> #include <stdio.h> #include <sys/types.h> #ifdef SYSV40 @@ -17,6 +22,9 @@ static char sccsid[] = "@(#) pmap_set.c 1.1 92/06/11 22:53:16"; #include <rpc/rpc.h> #include <rpc/pmap_clnt.h> +int parse_line __P((char *, u_long *, u_long *, int *, unsigned *)); + +int main(argc, argv) int argc; char **argv; @@ -32,17 +40,18 @@ char **argv; while (fgets(buf, sizeof(buf), stdin)) { if (parse_line(buf, &prog, &vers, &prot, &port) == 0) { - fprintf(stderr, "%s: malformed line: %s", argv[0], buf); + warnx("malformed line: %s", buf); return (1); } if (pmap_set(prog, vers, prot, (unsigned short) port) == 0) - fprintf(stderr, "not registered: %s", buf); + warnx("not registered: %s", buf); } return (0); } /* parse_line - convert line to numbers */ +int parse_line(buf, prog, vers, prot, port) char *buf; u_long *prog; |