getopt(3) returns -1, not EOF.

This commit is contained in:
Kevin Lo 2007-02-06 08:48:28 +00:00
parent 6a290a48ca
commit 9c20ad30e0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166529
5 changed files with 5 additions and 5 deletions

View File

@ -227,7 +227,7 @@ main(int ac, char *av[])
fp = stdout;
while ((x = getopt(ac, av, "do:")) != EOF) {
while ((x = getopt(ac, av, "do:")) != -1) {
switch(x) {
case 'd':
debug = 1;

View File

@ -70,7 +70,7 @@ DotCmd(int ac, char **av)
/* Get options */
optind = 1;
while ((ch = getopt(ac, av, "")) != EOF) {
while ((ch = getopt(ac, av, "")) != -1) {
switch (ch) {
case '?':
default:

View File

@ -73,7 +73,7 @@ ListCmd(int ac, char **av)
/* Get options */
optind = 1;
while ((ch = getopt(ac, av, "ln")) != EOF) {
while ((ch = getopt(ac, av, "ln")) != -1) {
switch (ch) {
case 'l':
list_hooks = 1;

View File

@ -147,7 +147,7 @@ main(int ac, char *av[])
snprintf(name, sizeof(name), "ngctl%d", getpid());
/* Parse command line */
while ((ch = getopt(ac, av, "df:n:")) != EOF) {
while ((ch = getopt(ac, av, "df:n:")) != -1) {
switch (ch) {
case 'd':
NgSetDebug(NgSetDebug(-1) + 1);

View File

@ -70,7 +70,7 @@ ShowCmd(int ac, char **av)
/* Get options */
optind = 1;
while ((ch = getopt(ac, av, "n")) != EOF) {
while ((ch = getopt(ac, av, "n")) != -1) {
switch (ch) {
case 'n':
no_hooks = 1;