Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Improve use of systemd's states
[src/app-framework-main.git]
/
src
/
afm-binding.c
diff --git
a/src/afm-binding.c
b/src/afm-binding.c
index
55010a2
..
1771520
100644
(file)
--- a/
src/afm-binding.c
+++ b/
src/afm-binding.c
@@
-402,7
+402,7
@@
static void start(afb_req_t req)
/* launch the application */
runid = afm_urun_start(appli, afb_req_get_uid(req));
/* launch the application */
runid = afm_urun_start(appli, afb_req_get_uid(req));
- if (runid <
=
0) {
+ if (runid < 0) {
cant_start(req);
return;
}
cant_start(req);
return;
}
@@
-412,7
+412,8
@@
static void start(afb_req_t req)
#if 0
wrap_json_pack(&resp, "{si}", _runid_, runid);
#else
#if 0
wrap_json_pack(&resp, "{si}", _runid_, runid);
#else
- wrap_json_pack(&resp, "i", runid);
+ if (runid)
+ wrap_json_pack(&resp, "i", runid);
#endif
afb_req_success(req, resp, NULL);
}
#endif
afb_req_success(req, resp, NULL);
}
@@
-439,13
+440,13
@@
static void once(afb_req_t req)
/* launch the application */
runid = afm_urun_once(appli, afb_req_get_uid(req));
/* launch the application */
runid = afm_urun_once(appli, afb_req_get_uid(req));
- if (runid <
=
0) {
+ if (runid < 0) {
cant_start(req);
return;
}
/* returns the state */
cant_start(req);
return;
}
/* returns the state */
- resp =
afm_urun_state(afudb, runid, afb_req_get_uid(req))
;
+ resp =
runid ? afm_urun_state(afudb, runid, afb_req_get_uid(req)) : NULL
;
afb_req_success(req, resp, NULL);
}
afb_req_success(req, resp, NULL);
}