Fixed wrong directory name issue, strlen() was off by one.

This commit is contained in:
Bahadir Balban
2008-04-15 01:51:13 +01:00
parent a9420d3dc9
commit fb249b0c5b
5 changed files with 6 additions and 3 deletions

2
README
View File

@@ -134,7 +134,7 @@ most fundamental posix calls and it implements modern features such as
demand-paging and virtual filesystem layer. Different from other posix-like
systems, it is based on a microkernel design. It has a cleanly separated set of
services, it is small and well-focused. Its design is carefully thought out, so
it's not just a mock-up implementation of an operating system API. Its source
it's not just a mock-up implementation of the existing POSIX API. Its source
code is also freely available (See LICENSE heading). For these reasons it is a
good candidate as systems software to be used on embedded platforms. Currently
it has little or no users, therefore compared to systems with a saturated user

View File

@@ -81,6 +81,8 @@ struct vnode *generic_vnode_lookup(struct vnode *thisnode,
* where path = { "//comp1/comp2", "/", "/comp1/comp2", "comp1/comp2" }
*/
printf("Looking up: %s\n", pdata->path);
/* Handle the special root case */
if (pdata->root)
component = pathdata_handle_root(pdata);

View File

@@ -49,6 +49,7 @@ int vfs_create(struct tcb *task, struct pathdata *pdata, unsigned int mode)
char *nodename;
int err;
printf("%s: %s\n", __FUNCTION__, pdata->path);
/* The last component is to be created */
nodename = splitpath_end(&pdata->path, '/');

View File

@@ -23,7 +23,7 @@ static inline int l4_mkdir(const char *pathname, mode_t mode)
int fd;
// write_mr(L4SYS_ARG0, (unsigned long)pathname);
copy_to_utcb((void *)pathname, 0, strlen(pathname));
copy_to_utcb((void *)pathname, 0, strlen(pathname) + 1);
write_mr(L4SYS_ARG0, (unsigned long)utcb_page);
write_mr(L4SYS_ARG1, (u32)mode);

View File

@@ -23,7 +23,7 @@ static inline int l4_open(const char *pathname, int flags, mode_t mode)
int fd;
// write_mr(L4SYS_ARG0, (unsigned long)pathname);
copy_to_utcb((void *)pathname, 0, strlen(pathname));
copy_to_utcb((void *)pathname, 0, strlen(pathname) + 1);
write_mr(L4SYS_ARG0, (unsigned long)utcb_page);
write_mr(L4SYS_ARG1, flags);
write_mr(L4SYS_ARG2, (u32)mode);