Module: wine Branch: master Commit: 037afca5a5c9c2561e5072e118a8a384a01ee814 URL: http://source.winehq.org/git/wine.git/?a=commit;h=037afca5a5c9c2561e5072e118...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Feb 28 10:47:14 2008 +0100
server: Unlink remaining children inodes when deleting the parent.
---
server/change.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/server/change.c b/server/change.c index 590a1cb..2266621 100644 --- a/server/change.c +++ b/server/change.c @@ -438,6 +438,7 @@ static void inode_set_name( struct inode *inode, const char *name ) static void free_inode( struct inode *inode ) { int subtree = 0, watches = 0; + struct inode *tmp, *next; struct dir *dir;
LIST_FOR_EACH_ENTRY( dir, &inode->dirs, struct dir, in_entry ) @@ -448,7 +449,6 @@ static void free_inode( struct inode *inode )
if (!subtree && !inode->parent) { - struct inode *tmp, *next; LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &inode->children, struct inode, ch_entry ) { @@ -464,6 +464,13 @@ static void free_inode( struct inode *inode ) if (inode->parent) list_remove( &inode->ch_entry );
+ /* disconnect remaining children from the parent */ + LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &inode->children, struct inode, ch_entry ) + { + list_remove( &tmp->ch_entry ); + tmp->parent = NULL; + } + if (inode->wd != -1) { inotify_remove_watch( get_unix_fd( inotify_fd ), inode->wd );