Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Jan 10, 2021
1 parent 3a03ccb commit 03d0f98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ static pid_t exec(const char *cmd_line)
pid_t pid = process_execute(cmd_line);
lock_release(&file_lock);

if (pid == TID_ERROR)
return -1;

struct process *child = get_child(pid);
sema_down(&child->sema_load);

Expand Down

0 comments on commit 03d0f98

Please sign in to comment.