diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-05-11 03:39:07 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-05-11 03:39:07 +0000 |
commit | 52853b95ebed443e023862f2a1db2614404699e5 (patch) | |
tree | 716f2d199f85543401f4e5818d0eaa6d67d6baf1 /win32 | |
parent | b4bcd66247e5bc9051bd228e0f63bc1a5ffcf2a7 (diff) | |
download | perl-52853b95ebed443e023862f2a1db2614404699e5.tar.gz |
PL_sys_intern was being initialized too late on windows
p4raw-id: //depot/perl@6104
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/win32/win32.c b/win32/win32.c index 008d7e0d94..c589ff5e88 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3968,18 +3968,6 @@ Perl_init_os_extras(void) char *file = __FILE__; dXSUB_SYS; - w32_perlshell_tokens = Nullch; - w32_perlshell_items = -1; - w32_fdpid = newAV(); /* XXX needs to be in Perl_win32_init()? */ - New(1313, w32_children, 1, child_tab); - w32_num_children = 0; - w32_init_socktype = 0; -#ifdef USE_ITHREADS - w32_pseudo_id = 0; - New(1313, w32_pseudo_children, 1, child_tab); - w32_num_pseudo_children = 0; -#endif - /* these names are Activeware compatible */ newXS("Win32::GetCwd", w32_GetCwd, file); newXS("Win32::SetCwd", w32_SetCwd, file); @@ -4037,16 +4025,36 @@ win32_get_child_IO(child_IO_table* ptbl) ptbl->childStdErr = GetStdHandle(STD_ERROR_HANDLE); } - -#ifdef USE_ITHREADS +#ifdef HAVE_INTERP_INTERN # ifdef PERL_OBJECT +# undef Perl_sys_intern_init +# define Perl_sys_intern_init CPerlObj::Perl_sys_intern_init # undef Perl_sys_intern_dup # define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup # define pPerl this # endif void +Perl_sys_intern_init(pTHX) +{ + w32_perlshell_tokens = Nullch; + w32_perlshell_vec = (char**)NULL; + w32_perlshell_items = 0; + w32_fdpid = newAV(); + New(1313, w32_children, 1, child_tab); + w32_num_children = 0; +# ifdef USE_ITHREADS + w32_pseudo_id = 0; + New(1313, w32_pseudo_children, 1, child_tab); + w32_num_pseudo_children = 0; +# endif + w32_init_socktype = 0; +} + +# ifdef USE_ITHREADS + +void Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst) { dst->perlshell_tokens = Nullch; @@ -4054,12 +4062,12 @@ Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst) dst->perlshell_items = 0; dst->fdpid = newAV(); Newz(1313, dst->children, 1, child_tab); - Newz(1313, dst->pseudo_children, 1, child_tab); dst->pseudo_id = 0; - dst->children->num = 0; + Newz(1313, dst->pseudo_children, 1, child_tab); dst->thr_intern.Winit_socktype = src->thr_intern.Winit_socktype; } -#endif +# endif /* USE_ITHREADS */ +#endif /* HAVE_INTERP_INTERN */ #ifdef PERL_OBJECT # undef this |