From 66a97007eb36a112f31e923c20e434ba8b39c4ba Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 16 Oct 2020 03:49:52 +0200 Subject: Matrix: use rapidjson instead of jsoncpp to decrease memory usage from 58mb to 24mb --- src/Program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Program.c') diff --git a/src/Program.c b/src/Program.c index 0ad19f2..2307798 100644 --- a/src/Program.c +++ b/src/Program.c @@ -116,26 +116,26 @@ int wait_program(pid_t process_id) { return WEXITSTATUS(status); } -bool wait_program_non_blocking(pid_t process_id, int *status) { +int wait_program_non_blocking(pid_t process_id, int *status) { int s; int wait_result = waitpid(process_id, &s, WNOHANG); if(wait_result == -1) { perror("waitpid failed"); *status = -errno; - return false; + return 0; } else if(wait_result == 0) { /* the child process is still running */ *status = 0; - return false; + return 0; } if(!WIFEXITED(s)) { *status = -4; - return false; + return 0; } *status = WEXITSTATUS(s); - return true; + return 1; } int exec_program_async(const char **args, pid_t *result_process_id) { -- cgit v1.2.3