1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

Let spawner kill subprocesses, bug 119387

This commit is contained in:
Markus Schorn 2006-04-28 08:33:43 +00:00
parent 17fe1a203d
commit 4cc10e41b6
7 changed files with 479 additions and 457 deletions

View file

@ -1,172 +1,175 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002 - 2005 QNX Software Systems and others. * Copyright (c) 2002 - 2005 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ * Wind River Systems, Inc.
#include "exec0.h" *******************************************************************************/
#include <unistd.h> #include "exec0.h"
#include <stdlib.h> #include <unistd.h>
#include <stdio.h> #include <stdlib.h>
#include <errno.h> #include <stdio.h>
#include <string.h> #include <errno.h>
#include <libgen.h> #include <string.h>
#include <stdlib.h> #include <libgen.h>
#include <termios.h> #include <stdlib.h>
#include <stropts.h> #include <termios.h>
#include <sys/ioctl.h> #include <stropts.h>
#include <sys/ioctl.h>
/* from pfind.c */
extern char *pfind(const char *name); /* from pfind.c */
extern char *pfind(const char *name);
pid_t
exec_pty(const char *path, char *const argv[], char *const envp[], pid_t
const char *dirpath, int channels[3], const char *pts_name, int fdm) exec_pty(const char *path, char *const argv[], char *const envp[],
{ const char *dirpath, int channels[3], const char *pts_name, int fdm)
int pipe2[2]; {
pid_t childpid; int pipe2[2];
char *full_path; pid_t childpid;
char *full_path;
/*
* We use pfind() to check that the program exists and is an executable. /*
* If not pass the error up. Also execve() wants a full path. * We use pfind() to check that the program exists and is an executable.
*/ * If not pass the error up. Also execve() wants a full path.
full_path = pfind(path); */
if (full_path == NULL) { full_path = pfind(path);
fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); if (full_path == NULL) {
return -1; fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
} return -1;
}
/*
* Make sure we can create our pipes before forking. /*
*/ * Make sure we can create our pipes before forking.
if (channels != NULL) { */
if (pipe(pipe2) < 0) { if (channels != NULL) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); if (pipe(pipe2) < 0) {
free(full_path); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
return -1; free(full_path);
} return -1;
} }
}
childpid = fork();
childpid = fork();
if (childpid < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); if (childpid < 0) {
free(full_path); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
return -1; free(full_path);
} else if (childpid == 0) { /* child */ return -1;
} else if (childpid == 0) { /* child */
chdir(dirpath);
chdir(dirpath);
if (channels != NULL) {
int fds; if (channels != NULL) {
int fds;
fds = ptys_open(fdm, pts_name);
if (fds < 0) { fds = ptys_open(fdm, pts_name);
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); if (fds < 0) {
return -1; fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
} return -1;
}
/* Close the read end of pipe2 */
if (close(pipe2[0]) == -1) /* Close the read end of pipe2 */
perror("close(pipe2[0]))"); if (close(pipe2[0]) == -1)
perror("close(pipe2[0]))");
/* close the master, no need in the child */
close(fdm); /* close the master, no need in the child */
close(fdm);
set_noecho(fds);
/* redirections */ set_noecho(fds);
dup2(fds, STDIN_FILENO); /* dup stdin */ /* redirections */
dup2(fds, STDOUT_FILENO); /* dup stdout */ dup2(fds, STDIN_FILENO); /* dup stdin */
dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ dup2(fds, STDOUT_FILENO); /* dup stdout */
close(fds); /* done with fds. */ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
} close(fds); /* done with fds. */
}
/* Close all the fd's in the child */
{ /* Close all the fd's in the child */
int fdlimit = sysconf(_SC_OPEN_MAX); {
int fd = 3; int fdlimit = sysconf(_SC_OPEN_MAX);
int fd = 3;
while (fd < fdlimit)
close(fd++); while (fd < fdlimit)
} close(fd++);
}
if (envp[0] == NULL) {
execv(full_path, argv); setpgid(getpid(), getpid());
} else {
execve(full_path, argv, envp); if (envp[0] == NULL) {
} execv(full_path, argv);
} else {
_exit(127); execve(full_path, argv, envp);
}
} else if (childpid != 0) { /* parent */
_exit(127);
ioctl(fdm, I_PUSH, "ptem");
set_noecho(fdm); } else if (childpid != 0) { /* parent */
if (channels != NULL) {
/* close the write end of pipe1 */ ioctl(fdm, I_PUSH, "ptem");
if (close(pipe2[1]) == -1) set_noecho(fdm);
perror("close(pipe2[1])"); if (channels != NULL) {
/* close the write end of pipe1 */
channels[0] = fdm; /* Input Stream. */ if (close(pipe2[1]) == -1)
channels[1] = fdm; /* Output Stream. */ perror("close(pipe2[1])");
channels[2] = pipe2[0]; /* stderr Stream. */
//channels[2] = fdm; /* Input Stream. */ channels[0] = fdm; /* Input Stream. */
} channels[1] = fdm; /* Output Stream. */
channels[2] = pipe2[0]; /* stderr Stream. */
free(full_path); //channels[2] = fdm; /* Input Stream. */
return childpid; }
}
free(full_path);
free(full_path); return childpid;
return -1; /*NOT REACHED */ }
}
#ifdef __STAND_ALONE__ free(full_path);
int main(int argc, char **argv, char **envp) { return -1; /*NOT REACHED */
const char *path = "./bufferring_test"; }
int channels[3] = { -1, -1, -1}; #ifdef __STAND_ALONE__
int status; int main(int argc, char **argv, char **envp) {
FILE *app_stdin; const char *path = "./bufferring_test";
FILE *app_stdout; int channels[3] = { -1, -1, -1};
FILE *app_stderr; int status;
char pts_name[32]; FILE *app_stdin;
int fdm; FILE *app_stdout;
char buffer[32]; FILE *app_stderr;
char pts_name[32];
fdm = ptym_open(pts_name); int fdm;
status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm); char buffer[32];
if (status >= 0) {
//app_stdin = fdopen(channels[0], "w"); fdm = ptym_open(pts_name);
app_stdout = fdopen(channels[1], "r"); status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
app_stderr = fdopen(channels[2], "r"); if (status >= 0) {
if (app_stdout == NULL || app_stderr == NULL /*|| app_stdin == NULL*/) { //app_stdin = fdopen(channels[0], "w");
fprintf(stderr, "PROBLEMS\n"); app_stdout = fdopen(channels[1], "r");
} else { app_stderr = fdopen(channels[2], "r");
printf("PID %d\n", status); if (app_stdout == NULL || app_stderr == NULL /*|| app_stdin == NULL*/) {
if (isatty(fdm)) { fprintf(stderr, "PROBLEMS\n");
printf("Is atty\n"); } else {
} printf("PID %d\n", status);
write(fdm, "foo\n", 4); if (isatty(fdm)) {
write(fdm, "bar\n", 4); printf("Is atty\n");
//fputs("foo\n", app_stdin); }
//fputs("bar\n", app_stdin); write(fdm, "foo\n", 4);
//fflush(app_stdin); write(fdm, "bar\n", 4);
while(fgets(buffer, sizeof buffer, app_stdout) != NULL) { //fputs("foo\n", app_stdin);
fprintf(stdout, "STDOUT: %s\n", buffer); //fputs("bar\n", app_stdin);
} //fflush(app_stdin);
while(fgets(buffer, sizeof buffer, app_stderr) != NULL) { while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
fprintf(stdout, "STDERR: %s\n", buffer); fprintf(stdout, "STDOUT: %s\n", buffer);
} }
} while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
} fprintf(stdout, "STDERR: %s\n", buffer);
fputs("bye\n", stdout); }
close(channels[0]); }
close(channels[1]); }
close(channels[2]); fputs("bye\n", stdout);
return 0; close(channels[0]);
} close(channels[1]);
#endif close(channels[2]);
return 0;
}
#endif

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc.
*******************************************************************************/ *******************************************************************************/
#include "exec0.h" #include "exec0.h"
#include <unistd.h> #include <unistd.h>
@ -90,6 +91,8 @@ exec0(const char *path, char *const argv[], char *const envp[],
close(fd++); close(fd++);
} }
setpgid(getpid(), getpid());
if (envp[0] == NULL) { if (envp[0] == NULL) {
execv(full_path, argv); execv(full_path, argv);
} else { } else {

View file

@ -1,285 +1,301 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002 - 2005 QNX Software Systems and others. * Copyright (c) 2002 - 2005 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ * Wind River Systems, Inc.
#include <unistd.h> *******************************************************************************/
#include <stdlib.h> #include <unistd.h>
#include <stdio.h> #include <stdlib.h>
#include <signal.h> #include <stdio.h>
#include <string.h> #include <signal.h>
#include <jni.h> #include <string.h>
#include <jni.h>
#include "exec0.h"
#include <Spawner.h> #include "exec0.h"
#include <Spawner.h>
#define DEBUGIT 0
#define DEBUGIT 0
/*
* Header for class org_eclipse_cdt_utils_spawner_Spawner /*
*/ * Header for class org_eclipse_cdt_utils_spawner_Spawner
*/
#if DEBUGIT
static void print_array(char **c_array) #if DEBUGIT
{ static void print_array(char **c_array)
if (c_array) { {
char **p = c_array; if (c_array) {
for (; *p; p++) { char **p = c_array;
if (*p) { for (; *p; p++) {
fprintf(stderr, " %s", *p); if (*p) {
} fprintf(stderr, " %s", *p);
} }
} else { }
fprintf(stderr, "null"); } else {
} fprintf(stderr, "null");
fprintf(stderr, "\n"); }
} fprintf(stderr, "\n");
#endif }
#endif
static char **alloc_c_array(JNIEnv * env, jobjectArray j_array)
{ static char **alloc_c_array(JNIEnv * env, jobjectArray j_array)
int i; {
jint c_array_size = (*env)->GetArrayLength(env, j_array); int i;
char **c_array = calloc(c_array_size + 1, sizeof(*c_array)); jint c_array_size = (*env)->GetArrayLength(env, j_array);
char **c_array = calloc(c_array_size + 1, sizeof(*c_array));
if (c_array == NULL)
return NULL; if (c_array == NULL)
return NULL;
for (i = 0; i < c_array_size; i++) {
jstring j_str = for (i = 0; i < c_array_size; i++) {
(jstring) (*env)->GetObjectArrayElement(env, j_array, i); jstring j_str =
const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL); (jstring) (*env)->GetObjectArrayElement(env, j_array, i);
c_array[i] = (char *) strdup(c_str); const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
(*env)->ReleaseStringUTFChars(env, j_str, c_str); c_array[i] = (char *) strdup(c_str);
(*env)->DeleteLocalRef(env, j_str); (*env)->ReleaseStringUTFChars(env, j_str, c_str);
} (*env)->DeleteLocalRef(env, j_str);
}
return c_array;
} return c_array;
}
static void free_c_array(char **c_array)
{ static void free_c_array(char **c_array)
if (c_array) { {
char **p = c_array; if (c_array) {
for (; *p; p++) { char **p = c_array;
if (*p) { for (; *p; p++) {
free(*p); if (*p) {
} free(*p);
} }
free(c_array); }
} free(c_array);
} }
}
/*
* Class: org_eclipse_cdt_utils_spawner_Spawner /*
* Method: exec2 * Class: org_eclipse_cdt_utils_spawner_Spawner
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I * Method: exec2
*/ * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2 */
(JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels, JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2
jstring jslaveName, jint masterFD) (JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels,
{ jstring jslaveName, jint masterFD)
jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **cmd; const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL);
char **envp; char **cmd;
int fd[3]; char **envp;
pid_t pid = -1; int fd[3];
pid_t pid = -1;
if (channels == NULL)
goto bail_out; if (channels == NULL)
goto bail_out;
cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) cmd = alloc_c_array(env, jcmd);
goto bail_out; if (cmd == NULL)
goto bail_out;
envp = alloc_c_array(env, jenv);
if (envp == NULL) envp = alloc_c_array(env, jenv);
goto bail_out; if (envp == NULL)
goto bail_out;
#if DEBUGIT
fprintf(stderr, "command:"); #if DEBUGIT
print_array(cmd); fprintf(stderr, "command:");
fprintf(stderr, "Envp:"); print_array(cmd);
print_array(envp); fprintf(stderr, "Envp:");
fprintf(stderr, "dirpath: %s\n", dirpath); print_array(envp);
fprintf(stderr, "pts_name: %s\n", pts_name); fprintf(stderr, "dirpath: %s\n", dirpath);
#endif fprintf(stderr, "pts_name: %s\n", pts_name);
#endif
pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD);
if (pid < 0) pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD);
goto bail_out; if (pid < 0)
goto bail_out;
channels[0] = fd[0];
channels[1] = fd[1]; channels[0] = fd[0];
channels[2] = fd[2]; channels[1] = fd[1];
channels[2] = fd[2];
bail_out:
(*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
(*env)->ReleaseStringUTFChars(env, jslaveName, pts_name); (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
if (cmd) (*env)->ReleaseStringUTFChars(env, jslaveName, pts_name);
free_c_array(cmd); if (cmd)
if (envp) free_c_array(cmd);
free_c_array(envp); if (envp)
return pid; free_c_array(envp);
} return pid;
}
JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj, JNIEXPORT jint JNICALL
jobjectArray jcmd, Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj,
jobjectArray jenv, jobjectArray jcmd,
jstring jdir) jobjectArray jenv,
{ jstring jdir)
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); {
char **cmd; const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **envp; char **cmd;
pid_t pid = -1; char **envp;
pid_t pid = -1;
cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) cmd = alloc_c_array(env, jcmd);
goto bail_out; if (cmd == NULL)
goto bail_out;
envp = alloc_c_array(env, jenv);
if (envp == NULL) envp = alloc_c_array(env, jenv);
goto bail_out; if (envp == NULL)
goto bail_out;
#if DEBUGIT
fprintf(stderr, "command:"); #if DEBUGIT
print_array(cmd); fprintf(stderr, "command:");
fprintf(stderr, "Envp:"); print_array(cmd);
print_array(envp); fprintf(stderr, "Envp:");
fprintf(stderr, "dirpath: %s\n", dirpath); print_array(envp);
#endif fprintf(stderr, "dirpath: %s\n", dirpath);
#endif
pid = exec0(cmd[0], cmd, envp, dirpath, NULL);
if (pid < 0) pid = exec0(cmd[0], cmd, envp, dirpath, NULL);
goto bail_out; if (pid < 0)
goto bail_out;
bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); bail_out:
if (cmd) (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
free_c_array(cmd); if (cmd)
if (envp) free_c_array(cmd);
free_c_array(envp); if (envp)
return pid; free_c_array(envp);
} return pid;
}
/*
* Class: org_eclipse_cdt_utils_spawner_Spawner /*
* Method: exec0 * Class: org_eclipse_cdt_utils_spawner_Spawner
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I * Method: exec0
*/ * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I
JNIEXPORT jint JNICALL */
Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj, JNIEXPORT jint JNICALL
jobjectArray jcmd, Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj,
jobjectArray jenv, jobjectArray jcmd,
jstring jdir, jobjectArray jenv,
jintArray jchannels) jstring jdir,
{ jintArray jchannels)
jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
char **cmd; const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **envp; char **cmd;
int fd[3]; char **envp;
pid_t pid = -1; int fd[3];
pid_t pid = -1;
if (channels == NULL)
goto bail_out; if (channels == NULL)
goto bail_out;
cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) cmd = alloc_c_array(env, jcmd);
goto bail_out; if (cmd == NULL)
goto bail_out;
envp = alloc_c_array(env, jenv);
if (envp == NULL) envp = alloc_c_array(env, jenv);
goto bail_out; if (envp == NULL)
goto bail_out;
#if DEBUGIT
fprintf(stderr, "command:"); #if DEBUGIT
print_array(cmd); fprintf(stderr, "command:");
fprintf(stderr, "Envp:"); print_array(cmd);
print_array(envp); fprintf(stderr, "Envp:");
fprintf(stderr, "dirpath: %s\n", dirpath); print_array(envp);
#endif fprintf(stderr, "dirpath: %s\n", dirpath);
#endif
pid = exec0(cmd[0], cmd, envp, dirpath, fd);
if (pid < 0) pid = exec0(cmd[0], cmd, envp, dirpath, fd);
goto bail_out; if (pid < 0)
goto bail_out;
channels[0] = fd[0];
channels[1] = fd[1]; channels[0] = fd[0];
channels[2] = fd[2]; channels[1] = fd[1];
channels[2] = fd[2];
bail_out:
(*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
if (cmd) (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
free_c_array(cmd); if (cmd)
if (envp) free_c_array(cmd);
free_c_array(envp); if (envp)
return pid; free_c_array(envp);
} return pid;
}
/*
* Class: org_eclipse_cdt_utils_spawner_Spawner /*
* Method: raise * Class: org_eclipse_cdt_utils_spawner_Spawner
* Signature: (II)I * Method: raise
*/ * Signature: (II)I
JNIEXPORT jint JNICALL */
Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj, JNIEXPORT jint JNICALL
jint pid, jint sig) Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj,
{ jint pid, jint sig)
int status = -1; {
int status = -1;
switch (sig) {
case 0: /* NOOP */ switch (sig) {
status = kill(pid, 0); case 0: /* NOOP */
break; status = killpg(pid, 0);
if(status == -1) {
case 2: /* INTERRUPT */ status = kill(pid, 0);
status = kill(pid, SIGINT); }
break; break;
case 9: /* KILL */ case 2: /* INTERRUPT */
status = kill(pid, SIGKILL); status = killpg(pid, SIGINT);
break; if(status == -1) {
status = kill(pid, SIGINT);
case 15: /* TERM */ }
status = kill(pid, SIGTERM); break;
break;
case 9: /* KILL */
default: status = killpg(pid, SIGKILL);
status = kill(pid, sig); /* WHAT ?? */ if(status == -1) {
break; status = kill(pid, SIGKILL);
} }
break;
return status;
} case 15: /* TERM */
status = killpg(pid, SIGTERM);
if(status == -1) {
status = kill(pid, SIGTERM);
/* }
* Class: org_eclipse_cdt_utils_spawner_Spawner break;
* Method: waitFor
* Signature: (I)I default:
*/ status = killpg(pid, sig); /* WHAT ?? */
JNIEXPORT jint JNICALL if(status == -1) {
Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env, status = kill(pid, sig); /* WHAT ?? */
jobject jobj, jint pid) }
{ break;
return wait0(pid); }
}
return status;
}
/*
* Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: waitFor
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env,
jobject jobj, jint pid)
{
return wait0(pid);
}