mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
Fixed the test harness so that it actually kills the ssh being used as
the SOCKS server.
This commit is contained in:
parent
6a84d492f1
commit
477e27f99d
3
CHANGES
3
CHANGES
@ -14,6 +14,9 @@ Dan F (8 June 2007)
|
|||||||
- Reverted some recent changes to runtests.pl that weren't compatible with
|
- Reverted some recent changes to runtests.pl that weren't compatible with
|
||||||
perl 5.0.
|
perl 5.0.
|
||||||
|
|
||||||
|
- Fixed the test harness so that it actually kills the ssh being used as
|
||||||
|
the SOCKS server.
|
||||||
|
|
||||||
Daniel S (6 June 2007)
|
Daniel S (6 June 2007)
|
||||||
- -s/--silent can now be used to toggle off the silence again if used a second
|
- -s/--silent can now be used to toggle off the silence again if used a second
|
||||||
time.
|
time.
|
||||||
|
@ -273,17 +273,12 @@ sub startnew {
|
|||||||
if(0 == $child) {
|
if(0 == $child) {
|
||||||
# Here we are the child. Run the given command.
|
# Here we are the child. Run the given command.
|
||||||
|
|
||||||
# Calling exec() within a pseudo-process actually spawns the requested
|
# Put an "exec" in front of the command so that the child process
|
||||||
# executable in a separate process and waits for it to complete before
|
# keeps this child's process ID.
|
||||||
# exiting with the same exit status as that process. This means that
|
exec("exec $cmd") || die "Can't exec() $cmd: $!";
|
||||||
# the process ID reported within the running executable will be
|
|
||||||
# different from what the earlier Perl fork() might have returned.
|
|
||||||
|
|
||||||
# exec() should never return back here to this process. We protect
|
# exec() should never return back here to this process. We protect
|
||||||
# ourselfs calling die() just in case something goes really bad.
|
# ourselves by calling die() just in case something goes really bad.
|
||||||
|
|
||||||
exec($cmd) || die "Can't exec() $cmd: $!";
|
|
||||||
|
|
||||||
die "error: exec() has returned";
|
die "error: exec() has returned";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,10 +287,10 @@ sub startnew {
|
|||||||
if ($fake) {
|
if ($fake) {
|
||||||
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
||||||
open(OUT, ">$pidfile");
|
open(OUT, ">$pidfile");
|
||||||
print OUT $child;
|
print OUT $child . "\n";
|
||||||
close(OUT);
|
close(OUT);
|
||||||
# could/should do a while connect fails sleep a bit and loop
|
# could/should do a while connect fails sleep a bit and loop
|
||||||
sleep 1;
|
sleep 2;
|
||||||
if (checkdied($child)) {
|
if (checkdied($child)) {
|
||||||
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
||||||
return (-1,-1);
|
return (-1,-1);
|
||||||
@ -326,6 +321,9 @@ sub startnew {
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return two PIDs, the one for the child process we spawned and the one
|
||||||
|
# reported by the server itself (in case it forked again on its own).
|
||||||
|
# Both (potentially) need to be killed at the end of the test.
|
||||||
return ($child, $pid2);
|
return ($child, $pid2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user