]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Test harness process control enhancements
authorYang Tse <yangsita@gmail.com>
Wed, 16 Dec 2009 19:55:35 +0000 (19:55 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 16 Dec 2009 19:55:35 +0000 (19:55 +0000)
tests/ftp.pm
tests/runtests.pl
tests/server/sws.c

index 28bbb4ea684827c5a118bb9aa02cf0b37282dc79..1b45014a6f18eec0f63475ec9d2a9944a39b33b3 100644 (file)
@@ -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+)$/) {
index ace609f72222a9f781620d0a216106cac0920826..33def4d915f020f411913217412926559d084eaf 100755 (executable)
@@ -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",
index 00fd74fe1076e5f9750bafaa1c520dc3787ec34c..5970f470c1db9f59a3b127cf92b2a0570f602a25 100644 (file)
@@ -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;