summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/KerneloopsScanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plugins/KerneloopsScanner.cpp')
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index 128e0837..1bb45aba 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -99,13 +99,14 @@ void CKerneloopsScanner::SaveOopsToDebugDump()
*second_line++ = '\0';
try
{
- CDebugDump debugDump;
- debugDump.Create(path, 0);
- debugDump.SaveText(FILENAME_ANALYZER, "Kerneloops");
- debugDump.SaveText(FILENAME_EXECUTABLE, "kernel");
- debugDump.SaveText(FILENAME_KERNEL, first_line);
- debugDump.SaveText(FILENAME_PACKAGE, "not_applicable");
- debugDump.SaveText(FILENAME_KERNELOOPS, second_line);
+ CDebugDump dd;
+ dd.Create(path, 0);
+ dd.SaveText(FILENAME_ANALYZER, "Kerneloops");
+ dd.SaveText(FILENAME_EXECUTABLE, "kernel");
+ dd.SaveText(FILENAME_KERNEL, first_line);
+ dd.SaveText(FILENAME_PACKAGE, "not_applicable");
+ dd.SaveText(FILENAME_CMDLINE, "not_applicable");
+ dd.SaveText(FILENAME_KERNELOOPS, second_line);
}
catch (CABRTException& e)
{
@@ -121,7 +122,7 @@ int CKerneloopsScanner::ScanDmesg()
int cnt_FoundOopses;
char *buffer;
- int pagesz = getpagesize();
+ long pagesz = sysconf(_SC_PAGESIZE);
buffer = (char*)xzalloc(pagesz + 1);
@@ -147,8 +148,10 @@ int CKerneloopsScanner::ScanSysLogFile(const char *filename)
if (fd < 0)
return 0;
statb.st_size = 0; /* paranoia */
- if (fstat(fd, &statb) != 0 || statb.st_size < 1)
+ if (fstat(fd, &statb) != 0 || statb.st_size < 1) {
+ close(fd);
return 0;
+ }
/*
* in theory there's a race here, since someone could spew