procd: fix service file tracking
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 18 Dec 2013 14:17:16 +0000 (14:17 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 18 Dec 2013 16:27:49 +0000 (16:27 +0000)
The instance_config_move() function in the procd instance managing code is
missing a blobmsg_list_move() call to update the tracked file items with the
newly calculated checksums in case of a file change.

Without that change, services are always reloaded after the first change to
a tracked file regardless of whether there are any subsequent changes or not.

Add a missing instance of blobmsg_list_free() as well.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
service/instance.c

index 27b81f5..3e784bf 100644 (file)
@@ -434,6 +434,7 @@ instance_config_cleanup(struct service_instance *in)
        blobmsg_list_free(&in->env);
        blobmsg_list_free(&in->data);
        blobmsg_list_free(&in->netdev);
        blobmsg_list_free(&in->env);
        blobmsg_list_free(&in->data);
        blobmsg_list_free(&in->netdev);
+       blobmsg_list_free(&in->file);
        blobmsg_list_free(&in->limits);
 }
 
        blobmsg_list_free(&in->limits);
 }
 
@@ -444,6 +445,7 @@ instance_config_move(struct service_instance *in, struct service_instance *in_sr
        blobmsg_list_move(&in->env, &in_src->env);
        blobmsg_list_move(&in->data, &in_src->data);
        blobmsg_list_move(&in->netdev, &in_src->netdev);
        blobmsg_list_move(&in->env, &in_src->env);
        blobmsg_list_move(&in->data, &in_src->data);
        blobmsg_list_move(&in->netdev, &in_src->netdev);
+       blobmsg_list_move(&in->file, &in_src->file);
        blobmsg_list_move(&in->limits, &in_src->limits);
        in->trigger = in_src->trigger;
        in->command = in_src->command;
        blobmsg_list_move(&in->limits, &in_src->limits);
        in->trigger = in_src->trigger;
        in->command = in_src->command;