[OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread 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 Votava --- service/

[OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread 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 Votava --- service/

Re: [OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread Paul Oranje
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

Re: [OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread John Crispin
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 +

[OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread ondrej . votava
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

Re: [OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread John Crispin
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;

[OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-23 Thread ondrej . votava
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

Re: [OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-20 Thread Petr Štetiar
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(

[OpenWrt-Devel] [PATCH] procd: show process's exit code

2020-01-20 Thread ondrej . votava
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