Skip to content
Snippets Groups Projects
Commit 015e1bec authored by kenth010's avatar kenth010
Browse files

lab1 komp?

parent 57a591a5
No related branches found
No related tags found
No related merge requests found
......@@ -36,14 +36,12 @@ syscall_handler(struct intr_frame *f UNUSED)
f->eax = filesys_open(file); //filesys open returnar struct file
if (f->eax == NULL)
{
//printf("open failed\n");
f->eax = -1;
}
else
{
//printf("it worked\n");
for (int i = 2; i <= 130; i++)
for (int i = 2; i <= 130; i++) //lägger in fil i fillistan
{
if (thread_current()->fileArray[i] == 0)
{
......@@ -68,7 +66,6 @@ syscall_handler(struct intr_frame *f UNUSED)
}
else if (thread_current()->fileArray[fd] == 0)
{
//printf("file does not exist");
f->eax = -1;
}
else
......@@ -83,14 +80,6 @@ syscall_handler(struct intr_frame *f UNUSED)
unsigned initial_size = *(unsigned *)(f->esp + 8);
f->eax = filesys_create(file, initial_size);
if (f->eax == true)
{
//printf("file was created\n");
}
else
{
//printf("file already exists\n");
}
break;
}
case SYS_READ:
......@@ -109,7 +98,6 @@ syscall_handler(struct intr_frame *f UNUSED)
}
else if (thread_current()->fileArray[fd] == 0)
{
//printf("file doesnt exist!");
f->eax = -1;
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment