Skip to content
Snippets Groups Projects
Commit 0f9bf9b6 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

Fix non-functional chdir()


I don't know how chdir() ever worked - apparently it didn't!

It took an argument "pathname", and then declared a local "path" and used
that, not pathname, as the path :-) Obviously, a call to task_conv, which
converts a relative "pathname" to an absolute "path", was missing...

chdir() is still a mess and incompatible in the error cases with Linux's
chdir(). I'll fix that, and add a test, in a follow-up patch.

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 333b0b3d
No related branches found
No related tags found
No related merge requests found
......@@ -702,6 +702,9 @@ int chdir(const char *pathname)
if (pathname == NULL)
goto out_errno;
if ((error = task_conv(t, pathname, VREAD, path)) != 0)
goto out_errno;
/* Check if directory exits */
error = sys_open(path, O_RDONLY, 0, &fp);
if (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment