diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-16 03:49:52 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-16 03:49:52 +0200 |
commit | 66a97007eb36a112f31e923c20e434ba8b39c4ba (patch) | |
tree | 026d4dd8dafe0d807e5480d538fa17a981b64508 /src/Program.c | |
parent | c23ceac642ea95081a239c7af9f882082addb8c1 (diff) |
Matrix: use rapidjson instead of jsoncpp to decrease memory usage from 58mb to 24mb
Diffstat (limited to 'src/Program.c')
-rw-r--r-- | src/Program.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) { |