X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so-v1.c;h=a341dac3e04f48b9bd717b73569b0f4c2bf1786a;hb=b355a2a65511c32aaaddf289d70395f872bd4b26;hp=3eea464597b0bfc0235c7c66d74ab4a288f903c5;hpb=11e2d4395056c7bd2a618b4fa7ffdd70af05d14e;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so-v1.c b/src/afb-api-so-v1.c index 3eea4645..a341dac3 100644 --- a/src/afb-api-so-v1.c +++ b/src/afb-api-so-v1.c @@ -88,7 +88,7 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct 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); @@ -101,7 +101,7 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct 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); @@ -116,6 +116,7 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct } /* Starts the service */ + desc->ditf.state = Daemon_Init; rc = afb_svc_start_v1(desc->service, init); if (rc < 0) { /* initialisation error */ @@ -125,6 +126,8 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct return rc; } +done: + desc->ditf.state = Daemon_Run; return 0; } @@ -304,6 +307,7 @@ int afb_api_so_v1_add(const char *path, void *handle, struct afb_apiset *apiset) 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;