From f3639cc4e823f83d00abffeeab5da47b07628548 Mon Sep 17 00:00:00 2001 From: gvf Date: Tue, 22 Apr 1997 16:01:19 +0000 Subject: [PATCH] minor clean to -q --- sys/arch/mvme68k/stand/bootsd/boot.c | 3 ++- sys/arch/mvme68k/stand/libsa/parse_args.c | 6 +++--- sys/arch/mvme68k/stand/netboot/boot.c | 12 ++++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/arch/mvme68k/stand/bootsd/boot.c b/sys/arch/mvme68k/stand/bootsd/boot.c index 1fcc0bdf2e6..4dda499227d 100644 --- a/sys/arch/mvme68k/stand/bootsd/boot.c +++ b/sys/arch/mvme68k/stand/bootsd/boot.c @@ -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; } diff --git a/sys/arch/mvme68k/stand/libsa/parse_args.c b/sys/arch/mvme68k/stand/libsa/parse_args.c index 25cecfcd533..6d4d4ac95d7 100644 --- a/sys/arch/mvme68k/stand/libsa/parse_args.c +++ b/sys/arch/mvme68k/stand/libsa/parse_args.c @@ -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; diff --git a/sys/arch/mvme68k/stand/netboot/boot.c b/sys/arch/mvme68k/stand/netboot/boot.c index 784134f2858..1797c1fb153 100644 --- a/sys/arch/mvme68k/stand/netboot/boot.c +++ b/sys/arch/mvme68k/stand/netboot/boot.c @@ -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; -- 2.20.1