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
This commit is contained in:
Mike Smith 1998-10-02 16:22:26 +00:00
parent a4c5722033
commit f9ba80b0e7
2 changed files with 12 additions and 6 deletions

View File

@ -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);
}

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: load_aout.c,v 1.6 1998/09/26 10:51:38 dfr Exp $
* $Id: load_aout.c,v 1.7 1998/09/30 19:26:23 peter Exp $
*/
#include <sys/param.h>
@ -212,7 +212,7 @@ aout_loadimage(int fd, vm_offset_t loadaddr, struct exec *ehdr, int kernel)
addr += sizeof(ehdr->a_syms);
/* symbol table */
printf("symbols=[0x%lx+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
return(0);
addr += ehdr->a_syms;
@ -222,7 +222,7 @@ aout_loadimage(int fd, vm_offset_t loadaddr, struct exec *ehdr, int kernel)
archsw.arch_copyin(&ss, addr, sizeof(ss));
addr += sizeof(ss);
ss -= sizeof(ss);
printf("+0x%lx+0x%x]", sizeof(ss), ss);
printf("+0x%x+0x%x]", sizeof(ss), ss);
if (archsw.arch_readin(fd, addr, ss) != ss)
return(0);
printf(" \n");