diff --git a/lib/libmain.c b/lib/libmain.c index 8a14b29..74df518 100644 --- a/lib/libmain.c +++ b/lib/libmain.c @@ -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)