syscalls: fix cwd-related stuff
This commit is contained in:
@@ -232,17 +232,15 @@ int sys_close(TrapFrame *tf)
|
||||
|
||||
int sys_chdir(TrapFrame *tf)
|
||||
{
|
||||
strcat(current->cwd->fat->path, "/");
|
||||
strcat(current->cwd->fat->path, (char*)tf->ebx);
|
||||
return fat_opendir(current->cwd, (const char*)tf->ebx);
|
||||
}
|
||||
|
||||
int sys_getcwd(TrapFrame *tf)
|
||||
{
|
||||
int len = tf->ecx;
|
||||
|
||||
if(len >= 260)
|
||||
return (int)NULL;
|
||||
|
||||
memcpy((void*)tf->ebx, current->cwd->fat->name, current->cwd->fat->namelen);
|
||||
strcpy((char*)tf->ebx, current->cwd->fat->path);
|
||||
|
||||
return tf->ebx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user