summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2002-05-02 15:44:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>2002-05-02 15:44:48 +0000
commit4efc5df63c21e7be3ddafb142377fe2511926c04 (patch)
treeab27aa859fec026d0dcbf95d8dd5ab4a03f08f06 /util.c
parent2fc614e01c5e692def72089696c0a1da4f6f3833 (diff)
downloadperl-4efc5df63c21e7be3ddafb142377fe2511926c04.tar.gz
manual integrate of change#16332 from maint-5.6 branch
p4raw-link: @16332 on //depot/maint-5.6/perl: 9bf7742e23b67e3d7c671615795c570c51951513 p4raw-id: //depot/perl@16348
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util.c b/util.c
index 35d54c350a..fe93c9933b 100644
--- a/util.c
+++ b/util.c
@@ -1594,6 +1594,11 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args)
void
Perl_my_setenv(pTHX_ char *nam, char *val)
{
+#ifdef USE_ITHREADS
+ /* only parent thread can modify process environment */
+ if (PL_curinterp == aTHX)
+#endif
+ {
#ifndef PERL_USE_SAFE_PUTENV
/* most putenv()s leak, so we manipulate environ directly */
register I32 i=setenv_getix(nam); /* where does it go? */
@@ -1652,6 +1657,7 @@ Perl_my_setenv(pTHX_ char *nam, char *val)
(void)putenv(new_env);
# endif /* __CYGWIN__ */
#endif /* PERL_USE_SAFE_PUTENV */
+ }
}
#else /* WIN32 || NETWARE */