Piotr Caban piotr@codeweavers.com writes:
-static int inode_check_dir( struct inode *parent, const char *name ) -{
- char *path;
- unsigned int filter;
- struct inode *inode;
- struct stat st;
- int wd = -1, r = -1;
- path = inode_get_path( parent, strlen(name) );
- if (!path)
return r;
- strcat( path, name );
- r = stat( path, &st );
- if (r < 0) goto end;
- if (!S_ISDIR(st.st_mode))
- {
r = 0;
goto end;
- }
- r = 1;
- filter = filter_from_inode( parent, 1 );
- if (!filter)
goto end;
- inode = inode_add( parent, st.st_dev, st.st_ino, name );
- if (!inode || inode->wd != -1)
goto end;
- wd = inotify_add_dir( path, filter );
- if (wd != -1)
inode_set_wd( inode, wd );
- else
free_inode( inode );
-end:
- free( path );
- return r;
-}
You can't remove all this, you still need to add a watch for newly created directories.