Fix sys_proc_create()'s error handling
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 7 Jun 2016 13:20:01 +0000 (09:20 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 17 Jun 2016 16:17:53 +0000 (12:17 -0400)
commit26f869d4e65b6319b429283fac964b564ccc9d19
tree47115a7c3b90fe8df5f5a46b0419a2559aad07b5
parentca19f269addd595dcb68a7718b1fcdd89740c3af
Fix sys_proc_create()'s error handling

I think we were dropping the file's kref for certain errors.  The
handling itself was a little confusing; I prefer the
"error_with_something_to_undo" style here, compared to the
"error_because_x_failed".

The other main thing is that we return an error early if a file is not
an elf, just like with sys_fork().  This will allow userspace to deal
with shell scripts.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/syscall.c