*/
#define _GNU_SOURCE
-#define AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO
#include <stdio.h>
#include <string.h>
if (desc->service != NULL) {
/* not an error when onneed */
if (onneed != 0)
- return 0;
+ goto done;
/* already started: it is an error */
ERROR("Service %s already started", desc->binding->v1.prefix);
if (init == NULL && onevent == NULL) {
/* not an error when onneed */
if (onneed != 0)
- return 0;
+ goto done;
/* no initialisation method */
ERROR("Binding %s is not a service", desc->binding->v1.prefix);
}
/* Starts the service */
+ desc->ditf.state = Daemon_Init;
rc = afb_svc_start_v1(desc->service, init);
if (rc < 0) {
/* initialisation error */
return rc;
}
+done:
+ desc->ditf.state = Daemon_Run;
return 0;
}