syscalls: make chdir follow path from the current->cwd and return 0 if there's no error

This commit is contained in:
2025-11-20 16:12:40 +03:00
parent a66a5da039
commit 827189593c
+5
View File
@@ -445,6 +445,8 @@ int sys_chdir(TrapFrame *tf)
l9660_dir new_cwd; l9660_dir new_cwd;
l9660_file placeholder_file; l9660_file placeholder_file;
new_cwd = *current->cwd;
int status = follow_path((char*)tf->ebx, &placeholder_file, &new_cwd); int status = follow_path((char*)tf->ebx, &placeholder_file, &new_cwd);
if(status == L9660_OK) if(status == L9660_OK)
@@ -466,6 +468,9 @@ int sys_chdir(TrapFrame *tf)
case L9660_ENOTDIR: case L9660_ENOTDIR:
return -20;//ENOTDIR return -20;//ENOTDIR
break; break;
case L9660_OK:
return 0;
break;
default: default:
return -5;//EIO return -5;//EIO
break; break;