From: Jarkko Hietaniemi Date: Thu, 24 Feb 2000 17:46:45 +0000 (+0000) Subject: MPE/ix patches from Mark Bixby. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0994c4d08152f97e3d70c5ce59ee93b0aa88684c;p=p5sagit%2Fp5-mst-13.2.git MPE/ix patches from Mark Bixby. p4raw-id: //depot/cfgperl@5239 --- diff --git a/pp_sys.c b/pp_sys.c index d5c5426..572da79 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4728,7 +4728,7 @@ PP(pp_gpwuid) PP(pp_gpwent) { djSP; -#if defined(HAS_PASSWD) && defined(HAS_GETPWENT) +#ifdef HAS_PASSWD I32 which = PL_op->op_type; register SV *sv; struct passwd *pwent; @@ -4742,7 +4742,11 @@ PP(pp_gpwent) else if (which == OP_GPWUID) pwent = getpwuid(POPi); else +#ifdef HAS_GETPWENT pwent = (struct passwd *)getpwent(); +#else + DIE(aTHX_ PL_no_func, "getpwent"); +#endif #ifdef HAS_GETSPNAM if (which == OP_GPWNAM) { @@ -4894,7 +4898,7 @@ PP(pp_ggrgid) PP(pp_ggrent) { djSP; -#if defined(HAS_GROUP) && defined(HAS_GETGRENT) +#ifdef HAS_GROUP I32 which = PL_op->op_type; register char **elem; register SV *sv; @@ -4906,7 +4910,11 @@ PP(pp_ggrent) else if (which == OP_GGRGID) grent = (struct group *)getgrgid(POPi); else +#ifdef HAS_GETGRENT grent = (struct group *)getgrent(); +#else + DIE(aTHX_ PL_no_func, "getgrent"); +#endif EXTEND(SP, 4); if (GIMME != G_ARRAY) { diff --git a/t/io/pipe.t b/t/io/pipe.t index 826cf74..ae890c0 100755 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -132,22 +132,27 @@ else { print "ok 10\n"; } -# check that status for the correct process is collected -my $zombie = fork or exit 37; -my $pipe = open *FH, "sleep 2;exit 13|" or die "Open: $!\n"; -$SIG{ALRM} = sub { return }; -alarm(1); -my $close = close FH; -if ($? == 13*256 && ! length $close && ! $!) { - print "ok 11\n"; -} else { - print "not ok 11\n# close $close\$?=$? \$!=", $!+0, ":$!\n"; -}; -my $wait = wait; -if ($? == 37*256 && $wait == $zombie && ! $!) { - print "ok 12\n"; +if ($^O eq 'mpeix') { + print "ok 11 # skipped\n"; + print "ok 12 # skipped\n"; } else { - print "not ok 12\n# pid=$wait first=$pid pipe=$pipe zombie=$zombie me=$$ \$?=$? \$!=", $!+0, ":$!\n"; + # check that status for the correct process is collected + my $zombie = fork or exit 37; + my $pipe = open *FH, "sleep 2;exit 13|" or die "Open: $!\n"; + $SIG{ALRM} = sub { return }; + alarm(1); + my $close = close FH; + if ($? == 13*256 && ! length $close && ! $!) { + print "ok 11\n"; + } else { + print "not ok 11\n# close $close\$?=$? \$!=", $!+0, ":$!\n"; + }; + my $wait = wait; + if ($? == 37*256 && $wait == $zombie && ! $!) { + print "ok 12\n"; + } else { + print "not ok 12\n# pid=$wait first=$pid pipe=$pipe zombie=$zombie me=$$ \$?=$? \$!=", $!+0, ":$!\n"; + } } # Test new semantics for missing command in piped open diff --git a/t/lib/glob-basic.t b/t/lib/glob-basic.t index a2479ac..ac3abf5 100755 --- a/t/lib/glob-basic.t +++ b/t/lib/glob-basic.t @@ -72,7 +72,7 @@ print "ok 5\n"; # check bad protections # should return an empty list, and set ERROR -if ($^O eq 'MSWin32' or $^O eq 'os2' or not $>) { +if ($^O eq 'mpeix' or $^O eq 'MSWin32' or $^O eq 'os2' or not $>) { print "ok 6 # skipped\n"; } else { diff --git a/t/lib/io_poll.t b/t/lib/io_poll.t index c179ce9..68ad7b7 100755 --- a/t/lib/io_poll.t +++ b/t/lib/io_poll.t @@ -7,6 +7,11 @@ BEGIN { } } +if ($^O eq 'mpeix') { + print "1..0 # Skip: broken on MPE/iX\n"; + exit 0; +} + select(STDERR); $| = 1; select(STDOUT); $| = 1; diff --git a/t/lib/io_sock.t b/t/lib/io_sock.t index 782f255..e03e223 100755 --- a/t/lib/io_sock.t +++ b/t/lib/io_sock.t @@ -169,20 +169,24 @@ $server = IO::Socket->new(Domain => AF_INET, LocalAddr => 'localhost'); $port = $server->sockport; -if ($pid = fork()) { - my $buf; - $server->recv($buf, 100); - print $buf; -} elsif (defined($pid)) { - #child - $sock = IO::Socket::INET->new(Proto => 'udp', - PeerAddr => "localhost:$port"); - $sock->send("ok 12\n"); - sleep(1); - $sock->send("ok 12\n"); # send another one to be sure - exit; +if ($^O eq 'mpeix') { + print("ok 12 # skipped\n") } else { - die; + if ($pid = fork()) { + my $buf; + $server->recv($buf, 100); + print $buf; + } elsif (defined($pid)) { + #child + $sock = IO::Socket::INET->new(Proto => 'udp', + PeerAddr => "localhost:$port"); + $sock->send("ok 12\n"); + sleep(1); + $sock->send("ok 12\n"); # send another one to be sure + exit; + } else { + die; + } } print "not " unless $server->blocking; diff --git a/t/op/die_exit.t b/t/op/die_exit.t index 7808d9d..cb0478b 100755 --- a/t/op/die_exit.t +++ b/t/op/die_exit.t @@ -9,6 +9,12 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib' if -e '../lib'; } + +if ($^O eq 'mpeix') { + print "1..0 # Skip: broken on MPE/iX\n"; + exit 0; +} + my $perl = -e '../perl' ? '../perl' : -e './perl' ? './perl' : 'perl'; use strict; diff --git a/t/op/exec.t b/t/op/exec.t index 5d01436..23e9ec1 100755 --- a/t/op/exec.t +++ b/t/op/exec.t @@ -25,8 +25,12 @@ print "not ok 3\n" if system "echo", "ok", "3"; # directly called # these should probably be rewritten to match the examples in perlfunc.pod if (system "true") {print "not ok 4\n";} else {print "ok 4\n";} -if ((system "/bin/sh -c 'exit 1'") != 256) { print "not "; } -print "ok 5\n"; +if ($^O eq 'mpeix') { + print "ok 5 # skipped: status broken on MPE/iX\n"; +} else { + if ((system "/bin/sh -c 'exit 1'") != 256) { print "not "; } + print "ok 5\n"; +} $rc = system "lskdfj"; if ($rc == 255 << 8 or $rc == -1 and diff --git a/t/op/fork.t b/t/op/fork.t index d82c04f..80c0b72 100755 --- a/t/op/fork.t +++ b/t/op/fork.t @@ -16,6 +16,11 @@ BEGIN { $ENV{PERL5LIB} = "../lib"; } +if ($^O eq 'mpeix') { + print "1..0 # Skip: fork/status problems on MPE/iX\n"; + exit 0; +} + $|=1; undef $/; diff --git a/t/op/stat.t b/t/op/stat.t index 37237f0..40f8f1f 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -164,7 +164,7 @@ else {print "not ok 33\n";} if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";} -if ($^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) { +if ($^O eq 'mpeix' or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) { print "ok 35 # skipped: no -u\n"; goto tty_test; }