]> sjero.net Git - wget/blobdiff - tests/FTPServer.pm
Avoid re-forking. Fixes bug #20458.
[wget] / tests / FTPServer.pm
index 7c7f3e584b4f0ed0c774013b314aa1113a319f3a..d8ad8b0c919a049f80d9e530237c095c99259153 100644 (file)
@@ -833,14 +833,14 @@ sub run
         print STDERR "got a connection from: $client_ipnum\n" if $log;
 
         # fork off a process to handle this connection.
-        my $pid = fork();
-        unless (defined $pid) {
-            warn "fork: $!";
-            sleep 5; # Back off in case system is overloaded.
-            next;
-        }
-
-        if ($pid == 0) { # Child process.
+        my $pid = fork();
+        unless (defined $pid) {
+            warn "fork: $!";
+            sleep 5; # Back off in case system is overloaded.
+            next;
+        }
+
+        if (1) { # Child process.
 
             # install signals
             $SIG{URG}  = sub {