1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-26 07:55:01 +00:00

getopt and friends are declared in <unistd.h>

getopt returns -1 not EOF.
This commit is contained in:
Warner Losh 2000-09-04 06:09:54 +00:00
parent b07b8563ff
commit 62f882d620
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65428
19 changed files with 13 additions and 41 deletions

View File

@ -1,11 +1,12 @@
/* $FreeBSD$ */
#include <stdio.h>
#include <unistd.h>
main(argc, argv)
int argc;
char *argv[];
{
extern int optind;
extern char *optarg;
int c;
int status = 0;

View File

@ -66,8 +66,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern int optind;
extern char *optarg;
enum { NOTSET, CLEAR, CLEARALL } clear;
int append, ch, fd, inherit, ops, pid, pidset, trpoints;
char *tracefile;

View File

@ -108,8 +108,6 @@ main(argc, argv)
int argc;
char *argv[];
{
extern int optind;
extern char *optarg;
int ch;
char *p;

View File

@ -65,7 +65,7 @@ char *argv[];
int c;
int vflag = 0;
while ((c = getopt(argc, argv, "vf:")) != EOF) {
while ((c = getopt(argc, argv, "vf:")) != -1) {
switch (c) {
case 'v':
vflag++;

View File

@ -97,6 +97,7 @@ static char sccsid[] = "@(#)locate.code.c 8.1 (Berkeley) 6/6/93";
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include "locate.h"
#define BGBUFSIZE (NBG * 2) /* size of bigram buffer */
@ -119,8 +120,6 @@ int bgindex __P((char *));
void usage __P((void));
extern int optind;
extern int optopt;
int
main(argc, argv)

View File

@ -140,10 +140,6 @@ extern u_char *tolower_word __P((u_char *));
extern int check_bigram_char __P((int));
extern char *patprep __P((char *));
extern char *optarg;
extern int optind;
int
main(argc, argv)
int argc;

View File

@ -139,12 +139,8 @@ struct keyblk keywrds[] = { /* m4 keywords to be installed */
#define MAXKEYS (sizeof(keywrds)/sizeof(struct keyblk))
extern int optind;
extern char *optarg;
void macro();
void initkwds();
extern int getopt();
int
main(argc,argv)

View File

@ -91,8 +91,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern int optind;
extern char *optarg;
u_int interval;
int clientOnly = -1;
int serverOnly = -1;

View File

@ -97,7 +97,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern int optind;
int ch, errors;
while ((ch = getopt(argc, argv, "agnoprtuwW")) != -1) {

View File

@ -68,7 +68,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern int optind;
int ch, eval, tflag;
tflag = 0;

View File

@ -144,8 +144,6 @@ main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind;
struct passwd *pw;
struct servent *sp;
struct sgttyb ttyb;

View File

@ -53,6 +53,7 @@ static char rcsid[] =
#include <rpc/pmap_clnt.h>
#include <signal.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/param.h>
#include <arpa/inet.h>
@ -89,8 +90,6 @@ main(argc, argv)
char **argv;
{
register int c;
extern char *optarg;
extern int optind;
int errflg;
int function;
u_short portnum;

View File

@ -208,7 +208,6 @@ int
main(int argc, char *argv[])
{
int ch;
extern int optind;
while ((ch = getopt(argc, argv, "?")) != -1)
switch (ch) {

View File

@ -78,8 +78,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern char *optarg;
extern int optind;
register int ch, cnt;
register u_char *C;
EXEC *head;

View File

@ -1202,9 +1202,6 @@ int
main(argc, argv)
int argc;
char **argv; {
extern char *optarg;
extern int optind;
extern int opterr;
char *term = NULL;
char *file = NULL;
int r;

View File

@ -43,6 +43,8 @@ static char copyright[] =
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 12/15/93";
#endif /* not lint */
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@ -125,10 +127,8 @@ main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind;
int ch;
char *user, *strrchr();
char *user;
char *src_addr = NULL;
#ifdef FORWARD
extern int forward_flags;

View File

@ -68,9 +68,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern char *optarg;
extern int optind;
register int pid;
int aflag, ch, lflag, status, pflag;
struct timeval before, after;

View File

@ -38,7 +38,11 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)tput.c 8.2 (Berkeley) 3/19/94";
#endif
static char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <termios.h>
@ -61,8 +65,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern char *optarg;
extern int optind;
int ch, exitval, n;
char *cptr, *p, *term, buf[1024], tbuf[1024];

View File

@ -109,8 +109,6 @@ main(argc, argv)
int argc;
char **argv;
{
extern int optind, opterr;
extern char *optarg;
struct passwd *pw;
ALIAS *cur;
time_t interval;