Properly set environment pointer.

This commit is contained in:
Danila Fedorin 2019-04-23 17:10:25 -07:00
parent f4e3196494
commit 9231075799
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ libmain(int argc, char **argv)
{
// set thisenv to point at our Env structure in envs[].
// LAB 3: Your code here.
thisenv = 0;
envid_t id = sys_getenvid();
thisenv = &envs[ENVX(id)];
// save the name of the program so that panic() can use it
if (argc > 0)