From fb249b0c5b5c433633f7a69807365bdc38f6aae9 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Tue, 15 Apr 2008 01:51:13 +0100 Subject: [PATCH] Fixed wrong directory name issue, strlen() was off by one. --- README | 2 +- tasks/fs0/src/lookup.c | 2 ++ tasks/fs0/src/syscalls.c | 1 + tasks/libposix/mkdir.c | 2 +- tasks/libposix/open.c | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README b/README index d60eda4..8fd2e82 100644 --- a/README +++ b/README @@ -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 diff --git a/tasks/fs0/src/lookup.c b/tasks/fs0/src/lookup.c index 410a017..2b71d21 100644 --- a/tasks/fs0/src/lookup.c +++ b/tasks/fs0/src/lookup.c @@ -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); diff --git a/tasks/fs0/src/syscalls.c b/tasks/fs0/src/syscalls.c index 4f20f7f..9d8d051 100644 --- a/tasks/fs0/src/syscalls.c +++ b/tasks/fs0/src/syscalls.c @@ -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, '/'); diff --git a/tasks/libposix/mkdir.c b/tasks/libposix/mkdir.c index e29f1ae..2b86824 100644 --- a/tasks/libposix/mkdir.c +++ b/tasks/libposix/mkdir.c @@ -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); diff --git a/tasks/libposix/open.c b/tasks/libposix/open.c index 7c8829d..b473863 100644 --- a/tasks/libposix/open.c +++ b/tasks/libposix/open.c @@ -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);