Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afb-ditf: track daemon state
[src/app-framework-binder.git]
/
src
/
afb-api-so-v2.c
diff --git
a/src/afb-api-so-v2.c
b/src/afb-api-so-v2.c
index
871be52
..
49fac6b
100644
(file)
--- 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)
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);
/* 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)
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);
/* 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 */
}
/* Starts the service */
+ desc->ditf.state = Daemon_Init;
rc = afb_svc_start_v2(desc->service, start);
if (rc < 0) {
/* initialisation error */
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;
}
return rc;
}
-
+done:
+ desc->ditf.state = Daemon_Run;
return 0;
}
return 0;
}