summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index de1175c..4da73b2 100644
--- a/exec.c
+++ b/exec.c
@@ -29,8 +29,9 @@ exec(char *path, char **argv)
sz = 0;
mem = 0;
- if((ip = ilock(namei(path))) == 0)
+ if((ip = namei(path)) == 0)
return -1;
+ ilock(ip);
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
goto bad;
@@ -112,8 +113,7 @@ exec(char *path, char **argv)
goto bad2;
memset(cp->mem + ph.va + ph.filesz, 0, ph.memsz - ph.filesz);
}
-
- iput(iunlock(ip));
+ iunlockput(ip);
cp->tf->eip = elf.entry;
cp->tf->esp = sp;
@@ -124,11 +124,11 @@ exec(char *path, char **argv)
bad:
if(mem)
kfree(mem, sz);
- iput(iunlock(ip));
+ iunlockput(ip);
return -1;
bad2:
- iput(iunlock(ip));
+ iunlockput(ip);
proc_exit();
return 0;
}