Skip to content

Commit

Permalink
Test harness process control enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtse committed Dec 16, 2009
1 parent 044ba6d commit 002ed5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tests/ftp.pm
Expand Up @@ -85,7 +85,11 @@ sub killpid {
# stop it, otherwise reap it if this has not been done yet.
my @signalled;
my $prev = 0;
my @pids = sort({$a <=> $b} split(/\s+/, $pidlist));
my @pids = split(' ', $pidlist);
if(scalar(@pids) > 2) {
my @sorted = sort({$a <=> $b} @pids);
@pids = @sorted;
}
foreach my $tmp (@pids) {
chomp $tmp;
if($tmp =~ /^(\d+)$/) {
Expand Down
2 changes: 1 addition & 1 deletion tests/runtests.pl
Expand Up @@ -2518,7 +2518,7 @@ sub stopservers {
my $pid;
my $prev;

foreach $pid (split(/\s+/, $pids)) {
foreach $pid (split(' ', $pids)) {
if($pid != $prev) {
# no need to kill same pid twice!
logmsg sprintf("* kill pid for %s => %d\n",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/sws.c
Expand Up @@ -927,7 +927,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
logmsg("Sent off %zd bytes", written);
}
/* write to file as well */
fwrite(buffer, 1, written, dump);
fwrite(buffer, 1, (size_t)written, dump);
if(got_exit_signal)
break;

Expand Down

0 comments on commit 002ed5f

Please sign in to comment.