*/
#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;
}
afb_ditf_rename(&desc->ditf, desc->binding->v1.prefix);
afb_api.closure = desc;
afb_api.itf = &so_v1_api_itf;
+ afb_api.noconcurrency = 0;
if (afb_apiset_add(apiset, desc->binding->v1.prefix, afb_api) < 0) {
ERROR("binding [%s] can't be registered...", path);
goto error2;