mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/NSProcessInfo.m ([NSProcessInfo +load]): Get environment
variables via environ even #ifdef HAVE_KVM (fix/based on #10113). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19928 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c1f55ee760
commit
4318301eb4
2 changed files with 19 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-08-26 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSProcessInfo.m ([NSProcessInfo +load]): Get environment
|
||||
variables via environ even #ifdef HAVE_KVM (fix/based on #10113).
|
||||
|
||||
2004-08-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSURLHandle.h:
|
||||
|
|
|
@ -373,13 +373,20 @@ static char **_gnu_noobjc_env = NULL;
|
|||
abort();
|
||||
}
|
||||
|
||||
/* get the environment vectors */
|
||||
vectors = kvm_getenvv(kptr, proc_ptr, 0);
|
||||
if (!vectors)
|
||||
{
|
||||
fprintf(stderr, "Error: libkvm does not return an environment for the current process\n");
|
||||
abort();
|
||||
}
|
||||
/* get the environment vectors the normal way, since this always works.
|
||||
On FreeBSD, the only other way is via /proc, and in later versions
|
||||
/proc is not mounted. */
|
||||
{
|
||||
extern char **environ;
|
||||
vectors = environ;
|
||||
if (!vectors)
|
||||
{
|
||||
fprintf(stderr, "Error: for some reason, environ == NULL "
|
||||
"during GNUstep base initialization\n"
|
||||
"Please check the linking process\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
/* copy the environment strings */
|
||||
for(count = 0; vectors[count]; count++)
|
||||
|
|
Loading…
Reference in a new issue