summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-01-02 00:03:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-01-02 00:03:05 +0000
commit34db0aedc65a0471d4f426c0824f48a300ce615d (patch)
treed7f0da9bc3417bade7f971a3220993551f5e70d6 /sys
parentb80841a404be578f204491e3121468f44c147b63 (diff)
loadrandom() status should be ignored, so that we do not loop.
issue reported by halex
Diffstat (limited to 'sys')
-rw-r--r--sys/stand/boot/boot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/stand/boot/boot.c b/sys/stand/boot/boot.c
index 7c8b6ebe810..91ed765eae6 100644
--- a/sys/stand/boot/boot.c
+++ b/sys/stand/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.38 2013/12/28 02:51:07 deraadt Exp $ */
+/* $OpenBSD: boot.c,v 1.39 2014/01/02 00:03:04 deraadt Exp $ */
/*
* Copyright (c) 2003 Dale Rahn
@@ -88,16 +88,17 @@ boot(dev_t bootdev)
printf("boot> ");
} while(!getcmd());
}
- st = 0;
- bootprompt = 1; /* allow reselect should we fail */
st = loadrandom(BOOTRANDOM, rnddata, sizeof(rnddata));
- if (st != 0)
+ if (st)
printf("loadrandom: error %d\n", st);
#ifdef MDRANDOM
mdrandom(rnddata, sizeof(rnddata));
#endif
+ st = 0;
+ bootprompt = 1; /* allow reselect should we fail */
+
printf("booting %s: ", cmd.path);
marks[MARK_START] = (u_long)cmd.addr;
if ((fd = loadfile(cmd.path, marks, LOAD_ALL)) != -1) {