From 92310757993d56ccce8d9a7eebd5ca90e4b5b614 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 23 Apr 2019 17:10:25 -0700 Subject: [PATCH] Properly set environment pointer. --- lib/libmain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)