CHDIR works.

Lookups on different current directory, including /./././/// works as expected.
This commit is contained in:
Bahadir Balban
2008-04-16 16:00:17 +01:00
parent 730e7c210f
commit 58033e7927
4 changed files with 70 additions and 6 deletions

View File

@@ -134,7 +134,7 @@ struct pathdata *pathdata_parse(const char *pathname,
/* Next component */
str = splitpath(&pathbuf, VFS_CHAR_SEP);
}
// pathdata_print(pdata);
pathdata_print(pdata);
return pdata;
}

View File

@@ -181,18 +181,23 @@ int sys_chdir(l4id_t sender, const char *pathname)
}
/* Get the vnode */
if (IS_ERR(v = vfs_lookup_bypath(pdata)))
return (int)v;
if (IS_ERR(v = vfs_lookup_bypath(pdata))) {
l4_ipc_return((int)v);
return 0;
}
/* Ensure it's a directory */
if (!vfs_isdir(v))
return -ENOTDIR;
if (!vfs_isdir(v)) {
l4_ipc_return(-ENOTDIR);
return 0;
}
/* Assign the current directory pointer */
task->curdir = v;
/* Destroy extracted path data */
pathdata_destroy(pdata);
l4_ipc_return(0);
return 0;
}