From 1270cfe3b306b01417c1ead19218b28b2f405d52 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Tue, 22 Apr 2008 01:41:18 +0100 Subject: [PATCH] open file descriptor references to vm files weren't properly initialised. This fixes the issue. sys_read/write yet to be inspected. --- tasks/mm0/src/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/mm0/src/file.c b/tasks/mm0/src/file.c index d101a4d..638f680 100644 --- a/tasks/mm0/src/file.c +++ b/tasks/mm0/src/file.c @@ -94,10 +94,14 @@ int vfs_receive_sys_open(l4id_t sender, l4id_t opener, int fd, return 0; } - /* Initialise and add it to global list */ + /* Initialise and add a reference to it from the task */ vm_file_to_vnum(vmfile) = vnum; vmfile->length = length; vmfile->vm_obj.pager = &file_pager; + t->fd[fd].vmfile = vmfile; + vmfile->vm_obj.refcnt++; + + /* Add to global list */ list_add(&vmfile->vm_obj.list, &vm_file_list); l4_ipc_return(0);