summaryrefslogtreecommitdiff
path: root/src/inotify.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-13 13:50:03 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-23 13:45:10 +0100
commitdb4b9c326ebc4dda44a72b6832382301920925be (patch)
treec14d931b6128abe708e6e1cfa331c64f7d0acb41 /src/inotify.c
parentdb2a311c9f4c77fec8f7baca6cd075ebf4806832 (diff)
downloadconnman-db4b9c326ebc4dda44a72b6832382301920925be.tar.gz
connman-db4b9c326ebc4dda44a72b6832382301920925be.tar.bz2
connman-db4b9c326ebc4dda44a72b6832382301920925be.zip
inotify: Watch out for files moved to/from watched dirs
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.
Diffstat (limited to 'src/inotify.c')
-rw-r--r--src/inotify.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/inotify.c b/src/inotify.c
index 6646f5e7..f451f1c0 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -116,7 +116,8 @@ static int create_watch(const char *path, struct connman_inotify *inotify)
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);