--- ./t/op/getppid.t-pre	Sun Jun  5 05:01:26 2005
+++ ./t/op/getppid.t	Tue Dec 12 23:53:20 2006
@@ -22,6 +22,7 @@ BEGIN {
 }
 
 pipe my ($r, $w) or die "pipe: $!\n";
+my $opid1 = $$;
 my $pid = fork; defined $pid or die "fork: $!\n";
 
 if ($pid) {
@@ -33,6 +34,7 @@ if ($pid) {
 else {
     # child
     close $r;
+    my $opid2 = $$;
     my $pid2 = fork; defined $pid2 or die "fork: $!\n";
     if ($pid2) {
 	close $w;
@@ -47,8 +49,9 @@ else {
 	my $ppid2 = getppid();
 	print $w "not " if $ppid1 == $ppid2;
 	print $w "ok 2 # ppid2=$ppid2, ppid1!=ppid2\n";
-	print $w "not " if $ppid2 != 1;
-	print $w "ok 3 # ppid2=1\n";
+	my $expected = ($^O eq 'os2' ? $opid1 : 1); # goes up the tree on OS/2
+	print $w "not " if $ppid2 != $expected;
+	print $w "ok 3 # ppid2 $ppid2==$expected [opid1=$opid1, opid2=$opid2]\n";
     }
     exit 0;
 }
