fix for ext/threads/t/problems.t failures
[p5sagit/p5-mst-13.2.git] / ext / threads / t / join.t
index f8b758e..7f8f1c8 100644 (file)
@@ -91,7 +91,8 @@ ok(1,"");
     ok(1,"");
 }
 
-if ($^O eq 'linux') { # We parse ps output so this is OS-dependent.
+# We parse ps output so this is OS-dependent.
+if ($^O eq 'linux') {
   # First modify $0 in a subthread.
   print "# mainthread: \$0 = $0\n";
   threads->new( sub {
@@ -100,14 +101,14 @@ if ($^O eq 'linux') { # We parse ps output so this is OS-dependent.
                  print "# subthread: \$0 = $0\n" } )->join;
   print "# mainthread: \$0 = $0\n";
   print "# pid = $$\n";
-  if (open PS, "ps -f |") { # Note: must work in (all) Linux(es).
+  if (open PS, "ps -f |") { # Note: must work in (all) systems.
     my ($sawpid, $sawexe);
     while (<PS>) {
       chomp;
       print "# [$_]\n";
       if (/^\S+\s+$$\s/) {
        $sawpid++;
-       if (/\sfoobar$/) {
+       if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
          $sawexe++;
         }
        last;