test.pl
Jerry D. Hedden [Fri, 11 Jul 2008 11:07:07 +0000 (07:07 -0400)]
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510807110807hb3e3727la161367a63da607f@mail.gmail.com>

Jerry found that localizing $? doesn't shield the effects of wait()
unless you actually assign something to $?

p4raw-id: //depot/perl@34147

t/test.pl

index e310f61..779933c 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -829,8 +829,8 @@ sub watchdog ($)
 
             # Add END block to parent to terminate and
             #   clean up watchdog process
-            eval "END { local \$!; local \$?;
-                        wait() if kill('KILL', $watchdog); }";
+            eval "END { local \$! = 0; local \$? = 0;
+                        wait() if kill('KILL', $watchdog); };";
             return;
         }
 
@@ -841,8 +841,8 @@ sub watchdog ($)
             if ($watchdog) {   # Parent process
                 # Add END block to parent to terminate and
                 #   clean up watchdog process
-                eval "END { local \$!; local \$?;
-                            wait() if kill('KILL', $watchdog); }";
+                eval "END { local \$! = 0; local \$? = 0;
+                            wait() if kill('KILL', $watchdog); };";
                 return;
             }