aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/c/exec.c
diff options
context:
space:
mode:
authorpacien2018-02-14 01:25:48 +0100
committerpacien2018-02-14 01:25:48 +0100
commit680fe07b6ea000ee29ac28e2f48665433e7011df (patch)
tree76b9f914a5092cbd1f96f5d749336fbd3e7a7a60 /app/src/main/c/exec.c
parent1eb53743996ffdabb6372a59f10d608f5830314e (diff)
downloadtincapp-680fe07b6ea000ee29ac28e2f48665433e7011df.tar.gz
Properly get daemon state
Diffstat (limited to 'app/src/main/c/exec.c')
-rw-r--r--app/src/main/c/exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/c/exec.c b/app/src/main/c/exec.c
index a9871a5..d665341 100644
--- a/app/src/main/c/exec.c
+++ b/app/src/main/c/exec.c
@@ -1,6 +1,7 @@
1#include <jni.h> 1#include <jni.h>
2#include <unistd.h> 2#include <unistd.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#include <sys/wait.h>
4 5
5static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) { 6static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) {
6 const int len = (*env)->GetArrayLength(env, ja); 7 const int len = (*env)->GetArrayLength(env, ja);
@@ -32,3 +33,8 @@ Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jo
32 return pid; 33 return pid;
33 } 34 }
34} 35}
36
37JNIEXPORT jint JNICALL
38Java_org_pacien_tincapp_commands_Executor_wait(JNIEnv *env, jclass class, jint pid) {
39 return waitpid(pid, NULL, 0);
40}