Created
October 1, 2009 16:08
-
-
Save yannk/199066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- lib/AnyEvent/orig.pm 2009-10-01 08:55:59.000000000 -0700 | |
+++ lib/AnyEvent/Util.pm 2009-10-01 09:02:05.000000000 -0700 | |
@@ -537,6 +537,10 @@ | |
See C<close_all_fds_except> for more details. | |
+=item pidref => \$scalar | |
+ | |
+A reference to a scalar where to store the pid of the run command. | |
+ | |
=back | |
Example: run C<rm -rf />, redirecting standard input, output and error to | |
@@ -546,6 +550,7 @@ | |
"<", "/dev/null", | |
">", "/dev/null", | |
"2>", "/dev/null"; | |
+ pidref => \my $pid, | |
$cv->recv and die "d'oh! something survived!" | |
Example: run F<openssl> and create a self-signed certificate and key, | |
@@ -712,6 +717,9 @@ | |
POSIX::_exit (126); | |
} | |
+ if (exists $arg{pidref}) { | |
+ ${$arg{pidref}} = $pid; | |
+ } | |
%redir = (); # close child side of the fds | |
my $status; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment