Signed-off-by: Felix Fietkau <nbd@nbd.name>
in_src->config = NULL;
}
-bool
+void
instance_update(struct service_instance *in, struct service_instance *in_new)
{
bool changed = instance_config_changed(in, in_new);
bool running = in->proc.pending;
- if (!changed && running)
- return false;
-
if (!running) {
- if (changed)
- instance_config_move(in, in_new);
+ instance_config_move(in, in_new);
instance_start(in);
} else {
- instance_restart(in);
+ if (changed)
+ instance_restart(in);
instance_config_move(in, in_new);
/* restart happens in the child callback handler */
}
- return true;
}
void
void instance_start(struct service_instance *in);
void instance_stop(struct service_instance *in);
-bool instance_update(struct service_instance *in, struct service_instance *in_new);
+void instance_update(struct service_instance *in, struct service_instance *in_new);
void instance_init(struct service_instance *in, struct service *s, struct blob_attr *config);
void instance_free(struct service_instance *in);
void instance_dump(struct blob_buf *b, struct service_instance *in, int debug);