From e1481ffc45a415d514159016e364a3da1fdaff45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 2 Sep 2002 14:57:33 +0000 Subject: [PATCH] Two fixes from NewOS (change 1606 & part of 1612) that made it into the VFS. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@959 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/fd.c | 2 +- src/kernel/core/fs/vfs.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel/core/fd.c b/src/kernel/core/fd.c index be0e1fef8d..21eb7279df 100644 --- a/src/kernel/core/fd.c +++ b/src/kernel/core/fd.c @@ -210,8 +210,8 @@ fd_dup2(int oldfd, int newfd, bool kernel) if (oldfd != newfd) { // Now do the work evicted = context->fds[newfd]; - context->fds[newfd] = context->fds[oldfd]; atomic_add(&context->fds[oldfd]->ref_count, 1); + context->fds[newfd] = context->fds[oldfd]; } mutex_unlock(&context->io_mutex); diff --git a/src/kernel/core/fs/vfs.c b/src/kernel/core/fs/vfs.c index f70d7206d6..db6e6ffd93 100755 --- a/src/kernel/core/fs/vfs.c +++ b/src/kernel/core/fs/vfs.c @@ -256,6 +256,9 @@ add_vnode_to_mount_list(struct vnode *v, struct fs_mount *mount) v->mount_next = mount->vnodes_head; v->mount_prev = NULL; + if (v->mount_next) + v->mount_next->mount_prev = v; + mount->vnodes_head = v; if (!mount->vnodes_tail) mount->vnodes_tail = v;