You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bn...@apache.org on 2002/03/14 18:19:02 UTC
cvs commit: apr/threadproc/netware proc.c
bnicholes 02/03/14 09:19:02
Modified: threadproc/netware proc.c
Log:
Changed the way environment variables are handle on NetWare while
spawning an external NLM
Revision Changes Path
1.9 +11 -3 apr/threadproc/netware/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/netware/proc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- proc.c 13 Mar 2002 20:39:30 -0000 1.8
+++ proc.c 14 Mar 2002 17:19:02 -0000 1.9
@@ -293,11 +293,12 @@
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 @@
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_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup,
apr_pool_cleanup_null);
}
+ /*if (sysenv)
+ free(sysenv);
+ */
return APR_SUCCESS;
}