summaryrefslogtreecommitdiff
path: root/threadproc/beos
diff options
context:
space:
mode:
authorDavid Reid <dreid@apache.org>2000-03-14 00:52:46 +0000
committerDavid Reid <dreid@apache.org>2000-03-14 00:52:46 +0000
commit75fc540fac8dba00ddd6f20c115bd130a6d47724 (patch)
tree4a0de1736613db5b5d9096afabe15c4736f4b1a4 /threadproc/beos
parent1527ff907c8491ed7c7326cbde814b10500ad57e (diff)
downloadapr-75fc540fac8dba00ddd6f20c115bd130a6d47724.tar.gz
Bunch of changes to get CGI's working better on BeOS.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59695 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/beos')
-rw-r--r--threadproc/beos/proc.c38
-rw-r--r--threadproc/beos/signals.c7
2 files changed, 27 insertions, 18 deletions
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
index 4f387f371..441e4cd2d 100644
--- a/threadproc/beos/proc.c
+++ b/threadproc/beos/proc.c
@@ -218,28 +218,33 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname,
i++;
}
- newargs = (char**)malloc(sizeof(char *) * (i + 3));
- newargs[0] = "/boot/home/config/bin/apr_proc_stub";
+ newargs = (char**)malloc(sizeof(char *) * (i + 4));
+ newargs[0] = strdup("/boot/home/config/bin/apr_proc_stub");
if (attr->currdir == NULL) {
- /* we require the directory ! */
+ /* we require the directory , so use a temp. variable */
dir = malloc(sizeof(char) * PATH_MAX);
getcwd(dir, PATH_MAX);
- newargs[1] = dir;
+ newargs[1] = strdup(dir);
free(dir);
} else {
- newargs[1] = attr->currdir;
- }
- newargs[2] = progname;
- i=0;nargs = 3;
+ newargs[1] = strdup(attr->currdir);
+ }
+ newargs[2] = strdup(progname);
+ i=0;nargs = 3;
- while (args && args[i]) {
- newargs[nargs] = args[i];
- i++;nargs++;
- }
- newargs[nargs] = NULL;
+ while (args && args[i]) {
+ newargs[nargs] = strdup(args[i]);
+ i++;nargs++;
+ }
+ newargs[nargs] = NULL;
newproc = load_image(nargs, newargs, env);
- free(newargs);
+
+ /* load_image copies the data so now we can free it... */
+ while (--nargs >= 0)
+ free (newargs[nargs]);
+ free(newargs);
+
if ( newproc < B_NO_ERROR) {
return errno;
}
@@ -306,9 +311,8 @@ ap_status_t ap_wait_proc(struct proc_t *proc,
if (get_thread_info(proc->tid, &tinfo) == B_BAD_VALUE) {
return APR_CHILD_DONE;
}
- else {
- return APR_CHILD_NOTDONE;
- }
+ /* if we get this far it's still going... */
+ return APR_CHILD_NOTDONE;
}
ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in,
diff --git a/threadproc/beos/signals.c b/threadproc/beos/signals.c
index 4fdff6b11..4cccc6e1b 100644
--- a/threadproc/beos/signals.c
+++ b/threadproc/beos/signals.c
@@ -57,7 +57,12 @@
ap_status_t ap_kill(struct proc_t *proc, int signal)
{
- if (kill(proc->pid, signal) == -1){
+/* I've changed this to use kill_thread instead of kill() as kill()
+ tended to kill the whole server! This isn't as good as it ignores
+ the signal being sent but gives more protection over what is killed.
+ I'll investiagte what was going on and hopefully fix it fully.
+*/
+ if (kill_thread(proc->tid) != B_OK){
return errno;
}
return APR_SUCCESS;