Various minor fixes.

Removed some commented out code.
Removed excessive printfs.
Fixed spid not initialising for mm0
Fixed some faults with fs0.

TODO:
- Need to store vfs files in a separate list.
- Need to define vnum as a vfs-file-specific data, i.e. in priv_data field of vm_file.
- Need to then fix vfs_receive_sys_open.
This commit is contained in:
Bahadir Balban
2008-03-24 22:39:21 +00:00
parent 13b9e5407a
commit 4b1abc60a6
13 changed files with 36 additions and 103 deletions

View File

@@ -91,7 +91,7 @@ int sys_open(l4id_t sender, const char *pathname, int flags, unsigned int mode)
/* Get the vnode */
if (IS_ERR(v = vfs_lookup_bypath(task, pathbuf))) {
if (!flags & O_CREAT) {
if (!(flags & O_CREAT)) {
return (int)v;
} else {
if ((err = vfs_create(task, pathname, mode)) < 0)
@@ -100,7 +100,7 @@ int sys_open(l4id_t sender, const char *pathname, int flags, unsigned int mode)
}
/* Get a new fd */
BUG_ON(!(fd = id_new(task->fdpool)));
BUG_ON((fd = id_new(task->fdpool)) < 0);
/* Assign the new fd with the vnode's number */
task->fd[fd] = v->vnum;

View File

@@ -115,6 +115,7 @@ struct tcb *create_tcb(void)
if (!(t = kmalloc(sizeof(*t))))
return PTR_ERR(-ENOMEM);
t->fdpool = id_pool_new_init(TASK_OFILES_MAX);
INIT_LIST_HEAD(&t->list);
list_add_tail(&t->list, &tcb_head.list);
tcb_head.total++;