From c4a6a4c4a7ee591ee2a9dfe2e118918707e4797e Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 3 Nov 2006 04:06:17 +0000 Subject: Make sure kern_envp is never NULL. If we don't get a pointer to the environment from the loader, use the static environment. --- sys/ia64/ia64/machdep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index e23ae4b..f3a875e 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -586,10 +586,11 @@ ia64_init(void) preload_metadata = (caddr_t)bootinfo.bi_modulep; else metadata_missing = 1; - if (envmode == 1) - kern_envp = static_env; - else + + if (envmode == 0 && bootinfo.bi_envp) kern_envp = (caddr_t)bootinfo.bi_envp; + else + kern_envp = static_env; /* * Look at arguments passed to us and compute boothowto. -- cgit v1.1