diff options
author | pacien | 2018-02-24 01:37:36 +0100 |
---|---|---|
committer | pacien | 2018-02-24 01:37:36 +0100 |
commit | 3c1a29e2b8717a20948773bbc21abdc723ce5dee (patch) | |
tree | d802e31724a27ac8d9a1c9e0d2ab730a225d5031 /app/src/main/c/exec.c | |
parent | c29970d29bd3c4831fc2f80077d1d8548ed0fc15 (diff) | |
download | tincapp-3c1a29e2b8717a20948773bbc21abdc723ce5dee.tar.gz |
Handle daemon startup failures
Diffstat (limited to 'app/src/main/c/exec.c')
-rw-r--r-- | app/src/main/c/exec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/c/exec.c b/app/src/main/c/exec.c index d665341..5a76177 100644 --- a/app/src/main/c/exec.c +++ b/app/src/main/c/exec.c | |||
@@ -36,5 +36,7 @@ Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jo | |||
36 | 36 | ||
37 | JNIEXPORT jint JNICALL | 37 | JNIEXPORT jint JNICALL |
38 | Java_org_pacien_tincapp_commands_Executor_wait(JNIEnv *env, jclass class, jint pid) { | 38 | Java_org_pacien_tincapp_commands_Executor_wait(JNIEnv *env, jclass class, jint pid) { |
39 | return waitpid(pid, NULL, 0); | 39 | int status; |
40 | waitpid(pid, &status, 0); | ||
41 | return WIFEXITED(status) ? WEXITSTATUS(status) : -1; | ||
40 | } | 42 | } |