summaryrefslogtreecommitdiff
path: root/threadproc/netware
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2002-03-14 17:19:02 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2002-03-14 17:19:02 +0000
commitd6b5d70c46c0a29348dff3d3cf5df85484734a36 (patch)
tree8a0a6a8176205fd81edfeb99b9c4b73e681127f5 /threadproc/netware
parent6a1b0358ccb89843de840ea9d3398710dae32054 (diff)
downloadlibapr-d6b5d70c46c0a29348dff3d3cf5df85484734a36.tar.gz
Changed the way environment variables are handle on NetWare while
spawning an external NLM git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63124 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/netware')
-rw-r--r--threadproc/netware/proc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
index 5f3d6da08..56cd25faf 100644
--- a/threadproc/netware/proc.c
+++ b/threadproc/netware/proc.c
@@ -293,11 +293,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
apr_procattr_t *attr,
apr_pool_t *cont)
{
- int i, envCount;
+ int i, envCount=0;
const char **newargs;
char **newenv;
NXVmId_t newVM;
unsigned long flags = 0;
+ char **sysenv = NULL;
NXNameSpec_t nameSpec;
NXExecEnvSpec_t envSpec;
@@ -313,16 +314,20 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
envSpec.esArgc = i;
envSpec.esArgv = (void**)args;
+ getenv("ENV"); /* just needs to be here for now */
+ sysenv = nxGetEnviron();
/* Count how many environment variables there are in the
system, add any new environment variables and place
them in the environment. */
for (i=0;env && env[i];i++);
- envCount = NXGetEnvCount();
+ for (envCount=0;sysenv && sysenv[envCount];envCount++);
if ((envCount + i) > 0) {
newenv = (char **) NXMemAlloc(sizeof(char *) * (envCount+i+1), 0);
if (!newenv)
return APR_ENOMEM;
- NXCopyEnv(newenv, envCount);
+ for (i=0;sysenv && sysenv[i];i++) {
+ newenv[i] = (char*)sysenv[i];
+ }
for (i=0;env && env[i];i++) {
newenv[envCount+i-1] = (char*)env[i];
}
@@ -418,6 +423,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
apr_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup,
apr_pool_cleanup_null);
}
+ /*if (sysenv)
+ free(sysenv);
+ */
return APR_SUCCESS;
}