getopt(3) returns -1, not EOF when out of args.

This commit is contained in:
Kevin Lo 2007-02-05 07:35:23 +00:00
parent 3ae3919d0b
commit 1c6adfcfdf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166509
4 changed files with 4 additions and 4 deletions

View File

@ -380,7 +380,7 @@ main(int argc, char *argv[])
bzero(args, sizeof(args));
what = LO_NONE;
while ((opt = getopt(argc, argv, "h")) != EOF) {
while ((opt = getopt(argc, argv, "h")) != -1) {
switch (opt) {
case 'h': case '?':
help();

View File

@ -69,7 +69,7 @@ static void
login(int argc, char *argv[], struct ncp_conn_loginfo *li) {
int error = 0, connid, opt, setprimary = 0;
while ((opt = getopt(argc, argv, STDPARAM_OPT"D")) != EOF){
while ((opt = getopt(argc, argv, STDPARAM_OPT"D")) != -1) {
switch(opt){
case STDPARAM_ARGS:
if (ncp_li_arg(li, opt, optarg))

View File

@ -650,7 +650,7 @@ main(int ac, char* av[])
char *prog;
int logopt = LOG_NDELAY | LOG_PID;
while ((ch = getopt(ac, av, "df:sv")) != EOF) {
while ((ch = getopt(ac, av, "df:sv")) != -1) {
switch (ch) {
case 'd':
daemonize = 0;

View File

@ -36,7 +36,7 @@ proc_arg(int ac, char **av)
tmp_dir = getenv("TMPDIR") ? getenv("TMPDIR") : tmp_dir;
while ((ch = getopt(ac, av, "ans:")) != EOF) {
while ((ch = getopt(ac, av, "ans:")) != -1) {
switch (ch) {
case 'a':
slot_map = ~0;