aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-11-20 16:47:56 +0000
committerYang Tse <yangsita@gmail.com>2007-11-20 16:47:56 +0000
commit6dfb5b4e1f5e267af29660a3ce6718f147f6e234 (patch)
tree64eaf328b65bd65d627970574ec5adffb7cc5a58
parent930085751c8a099e3896dbf69cdbfe72ce6f48cc (diff)
Don't gather additional debug info unless sshd actually fails
-rw-r--r--tests/sshserver.pl21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
index 695b3728d..049200941 100644
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -304,17 +304,24 @@ if (system "$sshd -t -f $conffile > log/sshd.log 2>&1") {
}
# Start the server
-my $rc = system "$sshd -e -D -f $conffile > log/sshd.log 2>&1";
-$rc >>= 8;
-if($rc && $verbose) {
- print STDERR "$sshd exited with $rc!\n";
+my $cmdretval = system "$sshd -e -D -f $conffile > log/sshd.log 2>&1";
+my $cmdnoexec = $!;
+if ($cmdretval == -1) {
+ print "$sshd failed with: \n";
+ print "$cmdnoexec \n";
+ displayfile("log/sshd.log");
+ displayfile("$conffile");
}
-if($rc) {
- print "$sshd exited with $rc!\n";
+elsif ($cmdretval & 127) {
+ printf("$sshd died with signal %d, and %s coredump.\n",
+ ($cmdretval & 127), ($cmdretval & 128)?"a":"no");
displayfile("log/sshd.log");
displayfile("$conffile");
}
+elsif ($verbose && ($cmdretval >> 8)) {
+ printf("$sshd exited with %d \n", $cmdretval >> 8);
+}
unlink $conffile;
-exit $rc;
+exit $cmdretval >> 8;