#129 minidilna creates multiple inotify watches for media dirs

open
nobody
None
5
2012-03-28
2012-03-28
Anonymous
No

The code block in inotify.c, lines 153 to 166 (introduced in commit v1.47) results in multiple add_watch calls for any base folder that is defined in minidlna.conf.
The first watch is set in the first loop where it iterates over all media_dirs.
Then it iterates over all paths that are in the database and adds a watch for each as well.

the media_dirs from the first for-loo should be excluded in the second loop.

I fixed the issue with the attached patch.

Discussion