diff options
author | Karel Klic <kklic@redhat.com> | 2010-01-18 13:19:54 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-01-18 13:19:54 +0100 |
commit | 4267cbcc29781ddcac00e259dfe05f3a26fbc2ec (patch) | |
tree | 213e47138967f1e7af4ee9ff9a3f2ed861cb5815 /lib/Plugins/KerneloopsScanner.cpp | |
parent | b2d1bd9e4f387c5a014d3002d741f25421c37aac (diff) | |
parent | b41833ed61f7b579d2a46b26d261616c21a6ae32 (diff) | |
download | abrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.tar.gz abrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.tar.xz abrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.zip |
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Plugins/KerneloopsScanner.cpp')
-rw-r--r-- | lib/Plugins/KerneloopsScanner.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp index 128e083..1bb45ab 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 |