Skip to content
Snippets Groups Projects
Commit f25586a4 authored by a2-stratford's avatar a2-stratford
Browse files

Added guard state for associating a file

parent 8ae93368
Branches
No related tags found
2 merge requests!22Merge Feature/system calls,!15Alex/27 implement open system call
......@@ -23,5 +23,10 @@ void syscall_open(struct intr_frame *f) {
}
// Described in system_calls.h, get a new file descriptor
int file_descriptor = associate_new_file_descriptor(file);
if (file_descriptor == -1) {
f->eax = -1; // Returning a failure state
return;
}
f->eax = file_descriptor; // Returning the file descriptor
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment