re PR libgcj/27892 (gij.cc:104: error: 'setenv' was not declared in this scope)

PR libgcj/27892:
	* gij.cc (main): Use putenv.

From-SVN: r114410
This commit is contained in:
Tom Tromey 2006-06-05 20:32:33 +00:00 committed by Tom Tromey
parent 0c397f9c8d
commit 8a398c2c8a
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-06-05 Tom Tromey <tromey@redhat.com>
PR libgcj/27892:
* gij.cc (main): Use putenv.
2006-06-03 Paolo Bonzini <bonzini@gnu.org>
* scripts/jar.in: Ensure return with argument has non-empty argument.

View File

@ -101,7 +101,12 @@ main (int argc, char const** argv)
if (! libpath || strcmp (libpath, newpath))
{
setenv (LTDL_SHLIBPATH_VAR, newpath, 1);
char *buffer = (char *) JvMalloc (strlen (LTDL_SHLIBPATH_VAR)
+ strlen (newpath) + 2);
strcpy (buffer, LTDL_SHLIBPATH_VAR);
strcat (buffer, "=");
strcat (buffer, newpath);
putenv (buffer);
JvFree (newpath);
int error_code = execvp (argv[0], (char* const*) argv);