X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so-v2.c;fp=src%2Fafb-api-so-v2.c;h=49fac6b6ee14f1c5a2941d584546034d8882d31b;hb=36c7ab15e79d6b0ff6188b61da1061f36b902f8e;hp=871be5249b50008b08ee7cc0d51046536a300ba6;hpb=1da7c5d76ee6abca43b83485adcd66d3a1ba55f8;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so-v2.c b/src/afb-api-so-v2.c index 871be524..49fac6b6 100644 --- a/src/afb-api-so-v2.c +++ b/src/afb-api-so-v2.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->api); @@ -101,7 +101,7 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct if (start == 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->api); @@ -117,6 +117,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_v2(desc->service, start); if (rc < 0) { /* initialisation error */ @@ -126,7 +127,8 @@ static int service_start_cb(void *closure, int share_session, int onneed, struct return rc; } - +done: + desc->ditf.state = Daemon_Run; return 0; }