Fix collection of kernel crash into /var/spool/crash

No kcrash was collected because the IsEnabled() test always failed:
we must do the kernel_collector->Enable() first.  I've not checked
if this might break the Override path (for local testing): it's more
important for the feature to work for real than in an artificial test.

BUG=837,5865
TEST=logging_KernelCrashServer or manual procedure

Signed-off-by: Hugh Dickins <hughd@chromium.org>

Review URL: http://codereview.chromium.org/3317007
This commit is contained in:
Hugh Dickins 2010-09-08 20:55:26 -07:00
parent 023e207f13
commit f174fc08dc

View file

@ -89,6 +89,7 @@ static int Initialize(KernelCollector *kernel_collector,
bool was_kernel_crash = false;
bool was_unclean_shutdown = false;
kernel_collector->Enable();
if (kernel_collector->IsEnabled()) {
was_kernel_crash = kernel_collector->Collect();
}
@ -111,7 +112,6 @@ static int Initialize(KernelCollector *kernel_collector,
}
// Must enable the unclean shutdown collector *after* collecting.
kernel_collector->Enable();
unclean_shutdown_collector->Enable();
user_collector->Enable();