compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
This commit is contained in:
parent
cdc0e920d8
commit
298d1ef2f1
@ -71,7 +71,7 @@
|
||||
/* File scope variables */
|
||||
|
||||
static char *namep;
|
||||
static char rcsid[] = "$Id$";
|
||||
static char rcsid[] = "$Id: atrun.c,v 1.8 1997/02/22 14:20:54 peter Exp $";
|
||||
static debug = 0;
|
||||
|
||||
void perr(const char *a);
|
||||
@ -390,7 +390,7 @@ main(int argc, char *argv[])
|
||||
|
||||
opterr = 0;
|
||||
errno = 0;
|
||||
while((c=getopt(argc, argv, "dl:"))!= EOF)
|
||||
while((c=getopt(argc, argv, "dl:"))!= -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ static char copyright[] =
|
||||
static char sccsid[] = "@(#)fingerd.c 8.1 (Berkeley) 6/4/93";
|
||||
*/
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: fingerd.c,v 1.7 1997/02/22 14:21:25 peter Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -80,7 +80,7 @@ main(argc, argv)
|
||||
logging = secure = 0;
|
||||
openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON);
|
||||
opterr = 0;
|
||||
while ((ch = getopt(argc, argv, "slp:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "slp:")) != -1)
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
logging = 1;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ftpd.c,v 1.33 1997/02/22 14:21:28 peter Exp $
|
||||
*/
|
||||
|
||||
#if 0
|
||||
@ -260,7 +260,7 @@ main(argc, argv, envp)
|
||||
|
||||
|
||||
bind_address.s_addr = htonl(INADDR_ANY);
|
||||
while ((ch = getopt(argc, argv, "AdlDSURt:T:u:va:p:")) != EOF) {
|
||||
while ((ch = getopt(argc, argv, "AdlDSURt:T:u:va:p:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'D':
|
||||
daemon_mode++;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: getNAME.c,v 1.4 1997/02/22 14:21:35 peter Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -73,7 +73,7 @@ main(argc, argv)
|
||||
extern int optind;
|
||||
int ch;
|
||||
|
||||
while ((ch = getopt(argc, argv, "itw")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "itw")) != -1)
|
||||
switch(ch) {
|
||||
case 'i':
|
||||
intro = 1;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: cleanerd.c,v 1.6 1997/02/22 14:21:44 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -160,7 +160,7 @@ main(argc, argv)
|
||||
extern int optind;
|
||||
|
||||
cmd_err = nodaemon = 0;
|
||||
while ((opt = getopt(argc, argv, "smd")) != EOF) {
|
||||
while ((opt = getopt(argc, argv, "smd")) != -1) {
|
||||
switch (opt) {
|
||||
case 's': /* small writes */
|
||||
do_small = 1;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: mail.local.c,v 1.12 1997/02/22 14:21:48 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -94,7 +94,7 @@ main(argc, argv)
|
||||
|
||||
from = NULL;
|
||||
nobiff = 0;
|
||||
while ((ch = getopt(argc, argv, "bdf:r:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "bdf:r:")) != -1)
|
||||
switch(ch) {
|
||||
case 'b':
|
||||
nobiff++;
|
||||
|
@ -35,7 +35,7 @@
|
||||
* Center for Telecommunications Research
|
||||
* Columbia University, New York City
|
||||
*
|
||||
* $Id$
|
||||
* $Id: mknetid.c,v 1.6 1997/02/22 14:21:54 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -55,7 +55,7 @@
|
||||
#include "hash.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id$";
|
||||
static const char rcsid[] = "$Id: mknetid.c,v 1.6 1997/02/22 14:21:54 peter Exp $";
|
||||
#endif
|
||||
|
||||
#define LINSIZ 1024
|
||||
@ -111,7 +111,7 @@ main(argc, argv)
|
||||
char *ptr, *pidptr, *gidptr, *hptr;
|
||||
int quiet = 0;
|
||||
|
||||
while ((ch = getopt(argc, argv, "g:p:h:n:d:q")) != EOF) {
|
||||
while ((ch = getopt(argc, argv, "g:p:h:n:d:q")) != -1) {
|
||||
switch(ch) {
|
||||
case 'g':
|
||||
groupfile = optarg;
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)rbootd.c 8.2 (Berkeley) 2/22/94
|
||||
* $Id$
|
||||
* $Id: rbootd.c,v 1.5 1997/02/22 14:21:58 peter Exp $
|
||||
*
|
||||
* Utah $Hdr: rbootd.c 3.1 92/07/06$
|
||||
* Author: Jeff Forys, University of Utah CSS
|
||||
@ -114,7 +114,7 @@ main(argc, argv)
|
||||
/*
|
||||
* Parse any arguments.
|
||||
*/
|
||||
while ((c = getopt(argc, argv, "adi:")) != EOF)
|
||||
while ((c = getopt(argc, argv, "adi:")) != -1)
|
||||
switch(c) {
|
||||
case 'a':
|
||||
BootAny++;
|
||||
|
@ -35,7 +35,7 @@
|
||||
* Center for Telecommunications Research
|
||||
* Columbia University, New York City
|
||||
*
|
||||
* $Id$
|
||||
* $Id: revnetgroup.c,v 1.6 1997/02/22 14:22:03 peter Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -46,7 +46,7 @@
|
||||
#include "hash.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id$";
|
||||
static const char rcsid[] = "$Id: revnetgroup.c,v 1.6 1997/02/22 14:22:03 peter Exp $";
|
||||
#endif
|
||||
|
||||
/* Default location of netgroup file. */
|
||||
@ -87,7 +87,7 @@ main(argc, argv)
|
||||
if (argc < 2)
|
||||
usage(argv[0]);
|
||||
|
||||
while ((ch = getopt(argc, argv, "uhf:")) != EOF) {
|
||||
while ((ch = getopt(argc, argv, "uhf:")) != -1) {
|
||||
switch(ch) {
|
||||
case 'u':
|
||||
if (hosts != -1) {
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rlogind.c,v 1.15 1997/02/22 14:22:08 peter Exp $
|
||||
* $Id: rlogind.c,v 1.16 1997/03/24 06:01:39 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -133,7 +133,7 @@ main(argc, argv)
|
||||
openlog("rlogind", LOG_PID | LOG_CONS, LOG_AUTH);
|
||||
|
||||
opterr = 0;
|
||||
while ((ch = getopt(argc, argv, ARGSTR)) != EOF)
|
||||
while ((ch = getopt(argc, argv, ARGSTR)) != -1)
|
||||
switch (ch) {
|
||||
case 'D':
|
||||
no_delay = 1;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: rshd.c,v 1.13 1997/02/22 14:22:23 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -112,7 +112,7 @@ main(argc, argv)
|
||||
openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
|
||||
|
||||
opterr = 0;
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != EOF)
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
check_all = 1;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: telnetd.c,v 1.10 1997/02/22 14:22:31 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -187,7 +187,7 @@ main(argc, argv)
|
||||
highpty = getnpty();
|
||||
#endif /* CRAY */
|
||||
|
||||
while ((ch = getopt(argc, argv, valid_opts)) != EOF) {
|
||||
while ((ch = getopt(argc, argv, valid_opts)) != -1) {
|
||||
switch(ch) {
|
||||
|
||||
#ifdef AUTHENTICATION
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tftpd.c,v 1.7 1997/02/22 14:22:36 peter Exp $
|
||||
* $Id: tftpd.c,v 1.8 1997/03/24 06:04:08 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -121,7 +121,7 @@ main(argc, argv)
|
||||
struct passwd *nobody;
|
||||
|
||||
openlog("tftpd", LOG_PID, LOG_FTP);
|
||||
while ((ch = getopt(argc, argv, "lns:")) != EOF) {
|
||||
while ((ch = getopt(argc, argv, "lns:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
logging = 1;
|
||||
|
@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ypxfr_main.c,v 1.8 1997/02/22 14:22:48 peter Exp $
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -51,7 +51,7 @@ struct dom_binding {};
|
||||
#include "ypxfr_extern.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id$";
|
||||
static const char rcsid[] = "$Id: ypxfr_main.c,v 1.8 1997/02/22 14:22:48 peter Exp $";
|
||||
#endif
|
||||
|
||||
char *progname = "ypxfr";
|
||||
@ -176,7 +176,7 @@ main(argc,argv)
|
||||
if (argc < 2)
|
||||
usage();
|
||||
|
||||
while ((ch = getopt(argc, argv, "fcd:h:s:p:C:")) != EOF) {
|
||||
while ((ch = getopt(argc, argv, "fcd:h:s:p:C:")) != -1) {
|
||||
int my_optind;
|
||||
switch(ch) {
|
||||
case 'f':
|
||||
|
Loading…
Reference in New Issue
Block a user