diff options
author | msmith <msmith@FreeBSD.org> | 1998-10-02 16:22:26 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-10-02 16:22:26 +0000 |
commit | 9844efc6b7fb0a3c2933de8d19143a12940308f2 (patch) | |
tree | ccaeb19c4c248eb70b2baabbd99aaa93237c1694 /sys/boot/common/boot.c | |
parent | a9d48ca05933036fc90583cb3b588beecaa467b7 (diff) | |
download | FreeBSD-src-9844efc6b7fb0a3c2933de8d19143a12940308f2.zip FreeBSD-src-9844efc6b7fb0a3c2933de8d19143a12940308f2.tar.gz |
boot.c
Increase the robustness of the "is it time to boot yet" test;
if the time skipped the "when" time, we would miss it.
Don't spin in an endless loop if we don't find the first possible
kernel suggested. When we run out, don't try to load an empty
kernel name.
load_aout.c
printf format warnings
Diffstat (limited to 'sys/boot/common/boot.c')
-rw-r--r-- | sys/boot/common/boot.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c index 85b5741..e0ea678 100644 --- a/sys/boot/common/boot.c +++ b/sys/boot/common/boot.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: boot.c,v 1.2 1998/08/31 21:10:42 msmith Exp $ + * $Id: boot.c,v 1.3 1998/09/28 22:03:01 peter Exp $ */ /* @@ -174,7 +174,7 @@ autoboot(int delay, char *prompt) break; } ntime = time(NULL); - if (ntime == when) { + if (ntime >= when) { yes = 1; break; } @@ -214,8 +214,10 @@ getbootfile(int try) if ((spec = getenv("bootfile")) == NULL) spec = default_bootfiles; - while ((try > 0) && (spec != NULL)) + while ((try > 0) && (spec != NULL)) { spec = strchr(spec, ','); + try--; + } if (spec != NULL) { if ((ep = strchr(spec, ',')) != NULL) { len = ep - spec; @@ -226,6 +228,10 @@ getbootfile(int try) strncpy(name, spec, len); name[len] = 0; } + if (name[0] == 0) { + free(name); + name = NULL; + } return(name); } |