When we do not watch watch for IN_MOVED_TO or IN_MOVED_FROM we can
easily inconsistent. The user creates a file and moves it then
from the watched directory. We wouldn't see this change and therefore
keep the configuration. That is a rather anoying behavoir
for the policy plugin.
return -EIO;
inotify->wd = inotify_add_watch(fd, path,
- IN_MODIFY | IN_CREATE | IN_DELETE);
+ IN_MODIFY | IN_CREATE | IN_DELETE |
+ IN_MOVED_TO | IN_MOVED_FROM);
if (inotify->wd < 0) {
connman_error("Creation of %s watch failed", path);
close(fd);