summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-02-09 19:24:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-02-09 19:24:09 +0000
commitcc4f8f3a7daa44b58ca76bee66bf8c1d1fbf2772 (patch)
tree1acc2656d6f03beae6dc17c4915eaae34b1a5695
parentb928eff7667d94d9cead0ebdc66ffa2216e01f31 (diff)
Process kernel options correctly when run from a `go' command instead of
`boot'.
-rw-r--r--sys/arch/loongson/loongson/machdep.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index 2b2425740d3..2148fd0301b 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.9 2010/02/05 20:51:22 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.10 2010/02/09 19:24:08 miod Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -592,22 +592,31 @@ dobootopts(int argc)
* boot file has been found.
*/
+ if (argc != 0) {
+ arg = pmon_getarg(0);
+ if (arg == NULL)
+ return;
+ /* if `go', not `boot', then no path and command options */
+ if (*arg == 'g')
+ ignore = 0;
+ }
for (i = 1; i < argc; i++) {
arg = pmon_getarg(i);
if (arg == NULL)
continue;
- if (*arg != '-') {
- /* found filename or non-option argument */
+ /* device path */
+ if (*arg == '/') {
if (*pmon_bootp == '\0') {
strlcpy(pmon_bootp, arg, sizeof pmon_bootp);
parsepmonbp();
}
- ignore = 0;
+ ignore = 0; /* further options are for the kernel */
continue;
}
- if (ignore)
+ /* not an option, or not a kernel option */
+ if (*arg != '-' || ignore)
continue;
for (cp = arg + 1; *cp != '\0'; cp++)