minor clean to -q
authorgvf <gvf@openbsd.org>
Tue, 22 Apr 1997 16:01:19 +0000 (16:01 +0000)
committergvf <gvf@openbsd.org>
Tue, 22 Apr 1997 16:01:19 +0000 (16:01 +0000)
sys/arch/mvme68k/stand/bootsd/boot.c
sys/arch/mvme68k/stand/libsa/parse_args.c
sys/arch/mvme68k/stand/netboot/boot.c

index 1fcc0bd..4dda499 100644 (file)
@@ -1,3 +1,4 @@
+/*     $OpenBSD: boot.c,v 1.10 1997/04/22 16:01:19 gvf Exp $ */
 /*     $NetBSD: boot.c,v 1.2 1995/09/23 03:42:52 gwr Exp $ */
 
 /*-
@@ -72,7 +73,7 @@ main()
                                ret = parse_args(&file, &flag);
                        }
                }
-               if ( ret == -1 ) {
+               if (ret) {
                        printf("boot: -q returning to MVME-Bug\n");
                        break;
                }
index 25cecfc..6d4d4ac 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse_args.c,v 1.3 1997/04/17 19:16:42 gvf Exp $ */
+/*     $OpenBSD: parse_args.c,v 1.4 1997/04/22 16:01:20 gvf Exp $ */
 
 /*-
  * Copyright (c) 1995 Theo de Raadt
@@ -73,7 +73,7 @@ int *flagp;
                        while (c == ' ')
                                c = *++ptr;
                        if (c == '\0')
-                               return;
+                               return (0);
                        if (c != '-') {
                                name = ptr;
                                while ((c = *++ptr) && c != ' ')
@@ -84,7 +84,7 @@ int *flagp;
                        }
                        while ((c = *++ptr) && c != ' ') {
                                if (c == 'q')
-                                       return (-1);
+                                       return (1);
                                for (i = 0; i < sizeof(bf)/sizeof(bf[0]); i++)
                                        if (bf[i].c == c) {
                                                howto |= bf[i].bit;
index 784134f..1797c1f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: boot.c,v 1.5 1996/05/16 02:55:36 chuck Exp $ */
+/*     $OpenBSD: boot.c,v 1.6 1997/04/22 16:01:21 gvf Exp $ */
 
 /*-
  * Copyright (c) 1995 Theo de Raadt
@@ -82,7 +82,7 @@ char  line[80];
 main()
 {
        char *cp, *file;
-       int ask = 0, howto;
+       int ask = 0, howto, ret;
 
        printf(">> OpenBSD MVME%x netboot [%s]\n", bugargs.cputyp, version);
        /* cycle in the correct args */
@@ -90,7 +90,7 @@ main()
        bugargs.arg_end   = bugargs.nbarg_end;
        *bugargs.arg_end = 0; /* ensure */
 
-       parse_args(&file, &howto);
+       ret = parse_args(&file, &howto);
 
        for (;;) {
                if (ask) {
@@ -102,9 +102,13 @@ main()
                                while (cp < (line + sizeof(line) - 1) && *cp) 
                                        cp++;
                                bugargs.arg_end = cp;
-                               parse_args(&file, &howto);
+                               ret =parse_args(&file, &howto);
                        }
                }
+               if (ret) {
+                       printf("boot: -q returning to MVME-Bug\n");
+                       break;
+               }
                exec_mvme(file, howto);
                printf("boot: %s: %s\n", file, strerror(errno));
                ask = 1;