Adds feature to show exit code of processes launched by procd.
The exit code is shown for finished process when ubus's
service list method is called.
The exit code value is computed according to waitpid(2)
and http://tldp.org/LDP/abs/html/exitcodes.html
Signed-off-by: Ondřej Votava
---
service/
Adds feature to show exit code of processes launched by procd.
The exit code is shown for finished process when ubus's
service list method is called.
The exit code value is computed according to waitpid(2)
and http://tldp.org/LDP/abs/html/exitcodes.html
Signed-off-by: Ondřej Votava
---
service/
Op 23 jan. 2020, om 14:15 heeft ondrej.vot...@cvut.cz het volgende geschreven:
>
> +static int
> +instance_exit_code(int ret)
> +{
> + if(WIFEXITED(ret)) {
> + return WEXITSTATUS(ret);
> + }
> + else if (WIFSIGNALED(ret)) {
The else should be omitted because, when the previ
On 23/01/2020 14:15, ondrej.vot...@cvut.cz wrote:
+static int
+instance_exit_code(int ret)
+{
+ if(WIFEXITED(ret)) {
^ missing space
+ return WEXITSTATUS(ret);
+ }
no new line here
+ else if (WIFSIGNALED(ret)) {
+ return 128 +
From: Ondřej Votava
Adds feature to show exit code of processes launched by procd.
The exit code is shown for finished process when ubus's
service list method is called.
The exit code value is computed according to waitpid(2)
and http://tldp.org/LDP/abs/html/exitcodes.html
Signed-off-by: Ondřej
On 23/01/2020 13:58, ondrej.vot...@cvut.cz wrote:
+static int
+instance_exit_code(int ret){
+ if(WIFEXITED(ret))
+ {
+ return WEXITSTATUS(ret);
+ }
+ else if (WIFSIGNALED(ret))
+ {
+ return 128 + WTERMSIG(ret);
+ }
+ return 1;
From: Ondřej Votava
Adds feature to show exit code of processes launched by procd.
The exit code is shown for finished process when ubus's
service list method is called.
The exit code value is computed according to waitpid(2)
and http://tldp.org/LDP/abs/html/exitcodes.html
Signed-off-by: Ondřej
ondrej.vot...@cvut.cz [2020-01-20 10:53:05]:
Ahoj,
this comment(if it's really needed and I doubt that) should go into commit
description, self-explaining code is prefered, everybody knows how to use man
pages already or knows how to use `git blame`.
> + /*
> + According to man waitpid(
From: Ondřej Votava
Adds feature to show process's exit code when
ubus service list is called.
Signed-off-by: Ondřej Votava
---
service/instance.c | 12
service/instance.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/service/instance.c b/service/instance.c
index abd1f34