getopt returns -1 not EOF, minor cleanup
This commit is contained in:
parent
c80b353465
commit
1dc35d9949
@ -1,4 +1,4 @@
|
|||||||
.\" $NetBSD: portmap.8,v 1.3 1997/10/17 05:37:35 mrg Exp $
|
.\" $NetBSD: portmap.8,v 1.4 1997/10/17 12:01:19 lukem Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1987 Sun Microsystems
|
.\" Copyright (c) 1987 Sun Microsystems
|
||||||
.\" Copyright (c) 1990, 1991, 1993
|
.\" Copyright (c) 1990, 1991, 1993
|
||||||
@ -45,10 +45,10 @@ port to
|
|||||||
.Tn RPC
|
.Tn RPC
|
||||||
program number mapper
|
program number mapper
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm portmap
|
.Nm
|
||||||
.Op Fl d
|
.Op Fl d
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm Portmap
|
.Nm
|
||||||
is a server that converts
|
is a server that converts
|
||||||
.Tn RPC
|
.Tn RPC
|
||||||
program numbers into
|
program numbers into
|
||||||
@ -61,7 +61,7 @@ calls.
|
|||||||
When an
|
When an
|
||||||
.Tn RPC
|
.Tn RPC
|
||||||
server is started, it will tell
|
server is started, it will tell
|
||||||
.Nm portmap
|
.Nm
|
||||||
what port number it is listening to, and what
|
what port number it is listening to, and what
|
||||||
.Tn RPC
|
.Tn RPC
|
||||||
program numbers it is prepared to serve.
|
program numbers it is prepared to serve.
|
||||||
@ -69,22 +69,22 @@ When a client wishes to make an
|
|||||||
.Tn RPC
|
.Tn RPC
|
||||||
call to a given program number,
|
call to a given program number,
|
||||||
it will first contact
|
it will first contact
|
||||||
.Nm portmap
|
.Nm
|
||||||
on the server machine to determine
|
on the server machine to determine
|
||||||
the port number where
|
the port number where
|
||||||
.Tn RPC
|
.Tn RPC
|
||||||
packets should be sent.
|
packets should be sent.
|
||||||
.Pp
|
.Pp
|
||||||
.Nm Portmap
|
.Nm
|
||||||
must be started before any
|
must be started before any
|
||||||
.Tn RPC
|
.Tn RPC
|
||||||
servers are invoked.
|
servers are invoked.
|
||||||
.Pp
|
.Pp
|
||||||
Normally
|
Normally
|
||||||
.Nm portmap
|
.Nm
|
||||||
forks and dissociates itself from the terminal
|
forks and dissociates itself from the terminal
|
||||||
like any other daemon.
|
like any other daemon.
|
||||||
.Nm Portmap
|
.Nm
|
||||||
then logs errors using
|
then logs errors using
|
||||||
.Xr syslog 3 .
|
.Xr syslog 3 .
|
||||||
.Pp
|
.Pp
|
||||||
@ -92,7 +92,7 @@ Option available:
|
|||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Fl d
|
.It Fl d
|
||||||
(debug) prevents
|
(debug) prevents
|
||||||
.Nm portmap
|
.Nm
|
||||||
from running as a daemon,
|
from running as a daemon,
|
||||||
and causes errors and debugging information
|
and causes errors and debugging information
|
||||||
to be printed to the standard error output.
|
to be printed to the standard error output.
|
||||||
@ -103,7 +103,7 @@ to be printed to the standard error output.
|
|||||||
.Xr inetd 8
|
.Xr inetd 8
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
If
|
If
|
||||||
.Nm portmap
|
.Nm
|
||||||
crashes, all servers must be restarted.
|
crashes, all servers must be restarted.
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
The
|
The
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: portmap.c,v 1.10 1997/10/17 05:37:37 mrg Exp $ */
|
/* $NetBSD: portmap.c,v 1.11 1997/10/17 12:01:25 lukem Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1990, 1993
|
* Copyright (c) 1990, 1993
|
||||||
@ -44,7 +44,7 @@ __COPYRIGHT(
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)portmap.c 8.1 (Berkeley) 6/6/93";
|
static char sccsid[] = "@(#)portmap.c 8.1 (Berkeley) 6/6/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: portmap.c,v 1.10 1997/10/17 05:37:37 mrg Exp $");
|
__RCSID("$NetBSD: portmap.c,v 1.11 1997/10/17 12:01:25 lukem Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ main(argc, argv)
|
|||||||
int len = sizeof(struct sockaddr_in);
|
int len = sizeof(struct sockaddr_in);
|
||||||
struct pmaplist *pml;
|
struct pmaplist *pml;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "d")) != EOF) {
|
while ((c = getopt(argc, argv, "d")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
|
Loading…
Reference in New Issue
Block a user