session_policy_local: Load policy when a new file is added
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 9 Apr 2013 16:13:13 +0000 (18:13 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 18 Apr 2013 05:44:08 +0000 (08:44 +0300)
When a file is added (not modified) we need to parse it as well

plugins/session_policy_local.c

index aa734a1..6a527cb 100644 (file)
@@ -404,6 +404,13 @@ static void notify_handler(struct inotify_event *event,
                        policy_ref(policy);
                else
                        policy = create_policy(ident);
+
+               err = load_policy(policy);
+               if (err < 0) {
+                       connman_warn("Loading policy file '%s' failed with %s",
+                                       ident, strerror(-err));
+                       return;
+               }
        }
 
        if (policy == NULL)