Added an inode object to keep track of all file descriptors open for a
given file.
Plugged a couple of potential file descriptor leaks.
diff --git a/server/thread.c b/server/thread.c
index 5d41a4a..3db8b1e 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -170,7 +170,7 @@
release_object( thread );
return NULL;
}
- if (!(thread->request_fd = alloc_fd( &thread_fd_ops, fd, &thread->obj )))
+ if (!(thread->request_fd = create_anonymous_fd( &thread_fd_ops, fd, &thread->obj )))
{
release_object( thread );
return NULL;
@@ -840,8 +840,8 @@
fatal_protocol_error( current, "bad wait fd\n" );
goto error;
}
- current->reply_fd = alloc_fd( &thread_fd_ops, reply_fd, ¤t->obj );
- current->wait_fd = alloc_fd( &thread_fd_ops, wait_fd, ¤t->obj );
+ current->reply_fd = create_anonymous_fd( &thread_fd_ops, reply_fd, ¤t->obj );
+ current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, ¤t->obj );
if (!current->reply_fd || !current->wait_fd) return;
current->unix_pid = req->unix_pid;