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
+1 -1
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 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 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 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 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 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 it has little or no users, therefore compared to systems with a saturated user
+2
View File
@@ -81,6 +81,8 @@ struct vnode *generic_vnode_lookup(struct vnode *thisnode,
* where path = { "//comp1/comp2", "/", "/comp1/comp2", "comp1/comp2" } * where path = { "//comp1/comp2", "/", "/comp1/comp2", "comp1/comp2" }
*/ */
printf("Looking up: %s\n", pdata->path);
/* Handle the special root case */ /* Handle the special root case */
if (pdata->root) if (pdata->root)
component = pathdata_handle_root(pdata); component = pathdata_handle_root(pdata);
+1
View File
@@ -49,6 +49,7 @@ int vfs_create(struct tcb *task, struct pathdata *pdata, unsigned int mode)
char *nodename; char *nodename;
int err; int err;
printf("%s: %s\n", __FUNCTION__, pdata->path);
/* The last component is to be created */ /* The last component is to be created */
nodename = splitpath_end(&pdata->path, '/'); nodename = splitpath_end(&pdata->path, '/');
+1 -1
View File
@@ -23,7 +23,7 @@ static inline int l4_mkdir(const char *pathname, mode_t mode)
int fd; int fd;
// write_mr(L4SYS_ARG0, (unsigned long)pathname); // 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_ARG0, (unsigned long)utcb_page);
write_mr(L4SYS_ARG1, (u32)mode); write_mr(L4SYS_ARG1, (u32)mode);
+1 -1
View File
@@ -23,7 +23,7 @@ static inline int l4_open(const char *pathname, int flags, mode_t mode)
int fd; int fd;
// write_mr(L4SYS_ARG0, (unsigned long)pathname); // 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_ARG0, (unsigned long)utcb_page);
write_mr(L4SYS_ARG1, flags); write_mr(L4SYS_ARG1, flags);
write_mr(L4SYS_ARG2, (u32)mode); write_mr(L4SYS_ARG2, (u32)mode);