summaryrefslogtreecommitdiffstats
path: root/src/afm-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afm-binding.c')
-rw-r--r--src/afm-binding.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/afm-binding.c b/src/afm-binding.c
index 55010a2..1771520 100644
--- 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));
- if (runid <= 0) {
+ if (runid < 0) {
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
- wrap_json_pack(&resp, "i", runid);
+ if (runid)
+ wrap_json_pack(&resp, "i", runid);
#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));
- if (runid <= 0) {
+ if (runid < 0) {
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);
}