From b98a89a763a437e17bc177e6e8431a0cb303a2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 28 Jul 2002 19:36:43 +0000 Subject: [PATCH] Forgot to set the stream type for the root directory... git-svn-id: file:///srv/svn/repos/haiku/trunk/current@516 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/fs/rootfs.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/kernel/core/fs/rootfs.c b/src/kernel/core/fs/rootfs.c index 390d5a885b..5cb7d6e139 100755 --- a/src/kernel/core/fs/rootfs.c +++ b/src/kernel/core/fs/rootfs.c @@ -232,7 +232,7 @@ static int rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id *root_vnid) { struct rootfs *fs; - struct rootfs_vnode *v; + struct rootfs_vnode *vnode; int err; TRACE(("rootfs_mount: entry\n")); @@ -248,39 +248,40 @@ rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id if (err < 0) goto err1; - fs->vnode_list_hash = hash_init(ROOTFS_HASH_SIZE, (addr)&v->all_next - (addr)v, + fs->vnode_list_hash = hash_init(ROOTFS_HASH_SIZE, (addr)&vnode->all_next - (addr)vnode, &rootfs_vnode_compare_func, &rootfs_vnode_hash_func); if (fs->vnode_list_hash == NULL) { err = ENOMEM; goto err2; } - // create a vnode - v = rootfs_create_vnode(fs); - if (v == NULL) { + // create the root vnode + vnode = rootfs_create_vnode(fs); + if (vnode == NULL) { err = ENOMEM; goto err3; } // set it up - v->parent = v; - v->name = kstrdup(""); - if (v->name == NULL) { + vnode->parent = vnode; + vnode->name = kstrdup(""); + if (vnode->name == NULL) { err = ENOMEM; goto err4; } - v->stream.dir.dir_head = NULL; - fs->root_vnode = v; - hash_insert(fs->vnode_list_hash, v); + vnode->stream.type = STREAM_TYPE_DIR; + vnode->stream.dir.dir_head = NULL; + fs->root_vnode = vnode; + hash_insert(fs->vnode_list_hash, vnode); - *root_vnid = v->id; + *root_vnid = vnode->id; *_fs = fs; return 0; err4: - rootfs_delete_vnode(fs, v, true); + rootfs_delete_vnode(fs, vnode, true); err3: hash_uninit(fs->vnode_list_hash); err2: