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