mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-26 11:47:31 +00:00
getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.
This commit is contained in:
parent
b07b8563ff
commit
62f882d620
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65428
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -108,8 +108,6 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
int ch;
|
||||
char *p;
|
||||
|
||||
|
@ -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++;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -97,7 +97,6 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
extern int optind;
|
||||
int ch, errors;
|
||||
|
||||
while ((ch = getopt(argc, argv, "agnoprtuwW")) != -1) {
|
||||
|
@ -68,7 +68,6 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
extern int optind;
|
||||
int ch, eval, tflag;
|
||||
|
||||
tflag = 0;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -208,7 +208,6 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
extern int optind;
|
||||
|
||||
while ((ch = getopt(argc, argv, "?")) != -1)
|
||||
switch (ch) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user