X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafm-run.c;h=4de0fd261b07ab3b9a96b61ad3d0471572dc4f8a;hb=d7890b93b8a0a9d0cd96b07f4b4e1326a52bc012;hp=18824f94030c74c9adfe24d8f04f597e8143e673;hpb=59e224c962345fdc30e3c67aa90627ad8771becf;p=src%2Fapp-framework-main.git diff --git a/src/afm-run.c b/src/afm-run.c index 18824f9..4de0fd2 100644 --- a/src/afm-run.c +++ b/src/afm-run.c @@ -421,7 +421,7 @@ static int fill_launch_desc(struct json_object *appli, static json_object *mkstate(struct apprun *runner) { const char *state; - struct json_object *result, *obj; + struct json_object *result, *obj, *pids; int rc; /* the structure */ @@ -433,6 +433,23 @@ static json_object *mkstate(struct apprun *runner) if (!j_add_integer(result, "runid", runner->runid)) goto error2; + /* the pids */ + switch(runner->state) { + case as_starting: + case as_running: + case as_stopped: + pids = j_add_new_array(result, "pids"); + if (!pids) + goto error2; + if (!j_add_integer(pids, NULL, runner->pids[0])) + goto error2; + if (runner->pids[1] && !j_add_integer(pids, NULL, runner->pids[1])) + goto error2; + break; + default: + break; + } + /* the state */ switch(runner->state) { case as_starting: