Change 11310 by gsar@moonru on 2001/07/12 15:50:40
fix for failing fork.t#12 on windows (win32_execvp() tweak in
change#11300 needs to return the status of failed win32_spawnvp())
fix various open.pm bugs: '\0' isn't the same as "\0", so it wasn't
splitting correctly; remove unused variables; 'require' at run time
rather than 'use' at compile time for I18N::Langinfo, since it
isn't everyware
Affected files ...
... //depot/perl/lib/open.pm#17 edit
... //depot/perl/win32/win32.c#164 edit
Differences ...
==== //depot/perl/lib/open.pm#17 (text) ====
Index: perl/lib/open.pm
--- perl/lib/open.pm.~1~ Thu Jul 12 10:00:05 2001
+++ perl/lib/open.pm Thu Jul 12 10:00:05 2001
@@ -10,9 +10,13 @@
sub _get_locale_encoding {
unless (defined $locale_encoding) {
- eval { use I18N::Langinfo qw(langinfo CODESET) };
+ eval {
+ # I18N::Langinfo isn't available everywhere
+ require I18N::Langinfo;
+ I18N::Langinfo->import('langinfo', 'CODESET');
+ };
unless ($@) {
- $locale_encoding = langinfo(CODESET);
+ $locale_encoding = langinfo(CODESET());
}
my $country_language;
if (not $locale_encoding && in_locale()) {
@@ -49,9 +53,7 @@
my ($class,@args) = @_;
croak("`use open' needs explicit list of disciplines") unless @args;
$^H |= $open::hint_bits;
- my ($in,$out) = split(/\0/,(${^OPEN} || '\0'));
- my @in = split(/\s+/,$in);
- my @out = split(/\s+/,$out);
+ my ($in,$out) = split(/\0/,(${^OPEN} || "\0"), -1);
while (@args) {
my $type = shift(@args);
my $discp = shift(@args);
==== //depot/perl/win32/win32.c#164 (text) ====
Index: perl/win32/win32.c
--- perl/win32/win32.c.~1~ Thu Jul 12 10:00:05 2001
+++ perl/win32/win32.c Thu Jul 12 10:00:05 2001
@@ -3363,8 +3363,13 @@
/* if this is a pseudo-forked child, we just want to spawn
* the new program, and return */
if (w32_pseudo_id) {
- my_exit(win32_spawnvp(P_WAIT, cmdname, (char *const *)argv));
- return 0;
+ int status = win32_spawnvp(P_WAIT, cmdname, (char *const *)argv);
+ if (status != -1) {
+ my_exit(status);
+ return 0;
+ }
+ else
+ return status;
}
#endif
return execvp(cmdname, (char *const *)argv);
End of Patch.