getopt(3) returns -1, not EOF.
This commit is contained in:
parent
6a290a48ca
commit
9c20ad30e0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166529
@ -227,7 +227,7 @@ main(int ac, char *av[])
|
|||||||
|
|
||||||
fp = stdout;
|
fp = stdout;
|
||||||
|
|
||||||
while ((x = getopt(ac, av, "do:")) != EOF) {
|
while ((x = getopt(ac, av, "do:")) != -1) {
|
||||||
switch(x) {
|
switch(x) {
|
||||||
case 'd':
|
case 'd':
|
||||||
debug = 1;
|
debug = 1;
|
||||||
|
@ -70,7 +70,7 @@ DotCmd(int ac, char **av)
|
|||||||
|
|
||||||
/* Get options */
|
/* Get options */
|
||||||
optind = 1;
|
optind = 1;
|
||||||
while ((ch = getopt(ac, av, "")) != EOF) {
|
while ((ch = getopt(ac, av, "")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
|
@ -73,7 +73,7 @@ ListCmd(int ac, char **av)
|
|||||||
|
|
||||||
/* Get options */
|
/* Get options */
|
||||||
optind = 1;
|
optind = 1;
|
||||||
while ((ch = getopt(ac, av, "ln")) != EOF) {
|
while ((ch = getopt(ac, av, "ln")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'l':
|
case 'l':
|
||||||
list_hooks = 1;
|
list_hooks = 1;
|
||||||
|
@ -147,7 +147,7 @@ main(int ac, char *av[])
|
|||||||
snprintf(name, sizeof(name), "ngctl%d", getpid());
|
snprintf(name, sizeof(name), "ngctl%d", getpid());
|
||||||
|
|
||||||
/* Parse command line */
|
/* Parse command line */
|
||||||
while ((ch = getopt(ac, av, "df:n:")) != EOF) {
|
while ((ch = getopt(ac, av, "df:n:")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'd':
|
case 'd':
|
||||||
NgSetDebug(NgSetDebug(-1) + 1);
|
NgSetDebug(NgSetDebug(-1) + 1);
|
||||||
|
@ -70,7 +70,7 @@ ShowCmd(int ac, char **av)
|
|||||||
|
|
||||||
/* Get options */
|
/* Get options */
|
||||||
optind = 1;
|
optind = 1;
|
||||||
while ((ch = getopt(ac, av, "n")) != EOF) {
|
while ((ch = getopt(ac, av, "n")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'n':
|
case 'n':
|
||||||
no_hooks = 1;
|
no_hooks = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user