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
renaming of verbs
[src/app-framework-main.git]
/
src
/
afm-run.c
diff --git
a/src/afm-run.c
b/src/afm-run.c
index
4de0fd2
..
131f9cb
100644
(file)
--- a/
src/afm-run.c
+++ b/
src/afm-run.c
@@
-51,7
+51,7
@@
enum appstate {
as_starting, /* start in progress */
as_running, /* started and running */
enum appstate {
as_starting, /* start in progress */
as_running, /* started and running */
- as_
stopped, /* stopp
ed */
+ as_
paused, /* paus
ed */
as_terminating, /* termination in progress */
as_terminated /* terminated */
};
as_terminating, /* termination in progress */
as_terminated /* terminated */
};
@@
-279,11
+279,11
@@
static void started(int runid)
{
}
{
}
-static void
stopp
ed(int runid)
+static void
paus
ed(int runid)
{
}
{
}
-static void
continu
ed(int runid)
+static void
resum
ed(int runid)
{
}
{
}
@@
-302,7
+302,7
@@
static void removed(int runid)
* for 'runid' and put the runner's state to 'tostate'
* in case of success.
*
* for 'runid' and put the runner's state to 'tostate'
* in case of success.
*
- * Only processes in the state 'as_running' or 'as_
stopp
ed'
+ * Only processes in the state 'as_running' or 'as_
paus
ed'
* can be signalled.
*
* Returns 0 in case of success or -1 in case of error.
* can be signalled.
*
* Returns 0 in case of success or -1 in case of error.
@@
-315,7
+315,7
@@
static int killrunner(int runid, int sig, enum appstate tostate)
errno = ENOENT;
rc = -1;
}
errno = ENOENT;
rc = -1;
}
- else if (runner->state != as_running && runner->state != as_
stopp
ed) {
+ else if (runner->state != as_running && runner->state != as_
paus
ed) {
errno = EINVAL;
rc = -1;
}
errno = EINVAL;
rc = -1;
}
@@
-354,13
+354,13
@@
static void on_sigchld(int signum, siginfo_t *info, void *uctxt)
pgid_remove(runner);
runner->next_by_pgid = terminated_runners;
terminated_runners = runner;
pgid_remove(runner);
runner->next_by_pgid = terminated_runners;
terminated_runners = runner;
- /* ensures that all the group
stop
s */
+ /* ensures that all the group
terminate
s */
killpg(runner->pids[0], SIGKILL);
break;
case CLD_STOPPED:
/* update the state */
killpg(runner->pids[0], SIGKILL);
break;
case CLD_STOPPED:
/* update the state */
- runner->state = as_
stopp
ed;
+ runner->state = as_
paus
ed;
break;
case CLD_CONTINUED:
break;
case CLD_CONTINUED:
@@
-437,7
+437,7
@@
static json_object *mkstate(struct apprun *runner)
switch(runner->state) {
case as_starting:
case as_running:
switch(runner->state) {
case as_starting:
case as_running:
- case as_
stopp
ed:
+ case as_
paus
ed:
pids = j_add_new_array(result, "pids");
if (!pids)
goto error2;
pids = j_add_new_array(result, "pids");
if (!pids)
goto error2;
@@
-456,8
+456,8
@@
static json_object *mkstate(struct apprun *runner)
case as_running:
state = "running";
break;
case as_running:
state = "running";
break;
- case as_
stopp
ed:
- state = "
stopp
ed";
+ case as_
paus
ed:
+ state = "
paus
ed";
break;
default:
state = "terminated";
break;
default:
state = "terminated";
@@
-558,9
+558,9
@@
int afm_run_terminate(int runid)
*
* Returns 0 in case of success or -1 in case of error
*/
*
* Returns 0 in case of success or -1 in case of error
*/
-int afm_run_
stop
(int runid)
+int afm_run_
pause
(int runid)
{
{
- return killrunner(runid, SIGSTOP, as_
stopp
ed);
+ return killrunner(runid, SIGSTOP, as_
paus
ed);
}
/*
}
/*
@@
-568,7
+568,7
@@
int afm_run_stop(int runid)
*
* Returns 0 in case of success or -1 in case of error
*/
*
* Returns 0 in case of success or -1 in case of error
*/
-int afm_run_
continu
e(int runid)
+int afm_run_
resum
e(int runid)
{
return killrunner(runid, SIGCONT, as_running);
}
{
return killrunner(runid, SIGCONT, as_running);
}