diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-26 13:03:01 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-26 13:03:01 +0000 |
commit | df3728a2a53a64c63edf08a4429a7a57b76ca4aa (patch) | |
tree | 41cb3c77a25414e4bf6259507dfbadcbc2ea463d /mg.c | |
parent | 9ece3ee6650e9c2f6d5131c19ae5e80f2a8bfc4a (diff) | |
download | perl-df3728a2a53a64c63edf08a4429a7a57b76ca4aa.tar.gz |
Integrate maintperl changes #12268 and #12669;
final touches to the audit for statics and thread-unsafe code
* make DB_File, ODBM_File thread-safe
* remove unnecessary/dangerous statics and protect others
from not getting accidentally enabled under threaded perls
windows support functions get_childdir() et al aren't exported
correctly under vanilla build
Testing under win32 appreciated since changes there had
to be manually merged and I cannot test how badly did I do.
p4raw-link: @12268 on //depot/perlio: bb407f0b8769c638c05e60ebfd157a1e676a6c22
p4raw-id: //depot/perl@12678
p4raw-integrated: from //depot/maint-5.6/perl@12677 'copy in'
win32/vmem.h (@5902..) 'merge in' ext/DB_File/DB_File.xs
(@8693..) win32/win32iop.h (@8917..) ext/ODBM_File/ODBM_File.xs
(@8995..) iperlsys.h (@9154..) scope.c (@9584..) makedef.pl
(@11425..) gv.c (@12026..) op.c (@12145..) util.c (@12220..)
toke.c (@12550..) ext/B/B.xs ext/File/Glob/Glob.xs
ext/Opcode/Opcode.xs ext/re/re.xs (@12653..) mg.c win32/win32.c
(@12668..)
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 30 |
1 files changed, 9 insertions, 21 deletions
@@ -959,27 +959,10 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) #if defined(VMS) || defined(EPOC) Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system"); #else -# ifdef PERL_IMPLICIT_SYS +# if defined(PERL_IMPLICIT_SYS) || defined(WIN32) PerlEnv_clearenv(); # else -# ifdef WIN32 - char *envv = GetEnvironmentStrings(); - char *cur = envv; - STRLEN len; - while (*cur) { - char *end = strchr(cur,'='); - if (end && end != cur) { - *end = '\0'; - my_setenv(cur,Nullch); - *end = '='; - cur = end + strlen(end+1)+2; - } - else if ((len = strlen(cur))) - cur += len+1; - } - FreeEnvironmentStrings(envv); -# else -#ifdef USE_ENVIRON_ARRAY +#if !defined(MACOS_TRADITIONAL) # ifndef PERL_USE_SAFE_PUTENV I32 i; @@ -992,8 +975,7 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) environ[0] = Nullch; -#endif /* USE_ENVIRON_ARRAY */ -# endif /* WIN32 */ +#endif /* !defined(MACOS_TRADITIONAL) */ # endif /* PERL_IMPLICIT_SYS */ #endif /* VMS */ return 0; @@ -2222,7 +2204,9 @@ Perl_whichsig(pTHX_ char *sig) return 0; } +#if !defined(PERL_IMPLICIT_CONTEXT) static SV* sig_sv; +#endif Signal_t Perl_sighandler(int sig) @@ -2290,7 +2274,9 @@ Perl_sighandler(int sig) if(PL_psig_name[sig]) { sv = SvREFCNT_inc(PL_psig_name[sig]); flags |= 64; +#if !defined(PERL_IMPLICIT_CONTEXT) sig_sv = sv; +#endif } else { sv = sv_newmortal(); sv_setpv(sv,PL_sig_name[sig]); @@ -2391,6 +2377,8 @@ unwind_handler_stack(pTHX_ void *p) if (flags & 1) PL_savestack_ix -= 5; /* Unprotect save in progress. */ /* cxstack_ix-- Not needed, die already unwound it. */ +#if !defined(PERL_IMPLICIT_CONTEXT) if (flags & 64) SvREFCNT_dec(sig_sv); +#endif } |