diff options
author | Eric Wong <e@80x24.org> | 2023-10-07 21:24:02 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-08 18:54:34 +0000 |
commit | 96787c294d7a089d2f72fae3da59c75d257542fc (patch) | |
tree | a672d9e436f6d437e7ac532e9bc308325f9a98e9 /xt | |
parent | 4c4466e455fd6940700125f8c21b326564915913 (diff) | |
download | public-inbox-96787c294d7a089d2f72fae3da59c75d257542fc.tar.gz |
We can just use the non-wantarray form of popen_rd to save us some extra error checking.
Diffstat (limited to 'xt')
-rw-r--r-- | xt/httpd-async-stream.t | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xt/httpd-async-stream.t b/xt/httpd-async-stream.t index 0658c691..904f2ae9 100644 --- a/xt/httpd-async-stream.t +++ b/xt/httpd-async-stream.t @@ -58,7 +58,7 @@ my $do_get_all = sub { my ($buf, $nr); my $bytes = 0; my $t0 = now(); - my ($rd, $pid) = popen_rd([$curl, @CURL_OPT, $url]); + my $rd = popen_rd([$curl, @CURL_OPT, $url]); while (1) { $nr = sysread($rd, $buf, 65536); last if !$nr; @@ -67,9 +67,7 @@ my $do_get_all = sub { } my $res = $dig->hexdigest; my $elapsed = sprintf('%0.3f', now() - $t0); - close $rd or die "close curl failed: $!\n"; - waitpid($pid, 0) == $pid or die "waitpid failed: $!\n"; - $? == 0 or die "curl failed: $?\n"; + close $rd or die "close curl failed: $! \$?=$?\n"; print STDERR "# $job $$ ($?) $res (${elapsed}s) $bytes bytes\n"; $res; }; |