We were handling closing of file descriptors incorrectly. The close_*()

and free_*_cookie() hooks of the underlying FS were always called
together when the reference count of the FD dropped to zero. When
blocking operations (reading/writing) on the FD were still in progress
this would never happen, though. Now we additionally maintain an open
count and call the close_*() hook when it drops to zero.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11882 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-03-17 20:25:07 +00:00
parent 92290ecd54
commit d49f1b87a0
2 changed files with 35 additions and 31 deletions
+1
View File
@@ -36,6 +36,7 @@ struct fd_ops {
struct file_descriptor {
int32 type; /* descriptor type */
int32 ref_count;
int32 open_count;
struct fd_ops *ops;
union {
struct vnode *vnode;