summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Arapov <aarapov@redhat.com>2009-04-01 11:09:59 +0200
committerAnton Arapov <aarapov@redhat.com>2009-04-01 11:09:59 +0200
commit84b0423bfe78f1b407fec1b3bb82a10c1817c25d (patch)
tree114ebaadaaf8cbd557f1b4fcef4b82498a611457 /lib
parent9466b938f7c79f394677f16ed9b128ab367e92fe (diff)
downloadabrt-84b0423bfe78f1b407fec1b3bb82a10c1817c25d.tar.gz
abrt-84b0423bfe78f1b407fec1b3bb82a10c1817c25d.tar.xz
abrt-84b0423bfe78f1b407fec1b3bb82a10c1817c25d.zip
kerneloops - plugin: fail gracefully.
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/Kerneloops.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Plugins/Kerneloops.cpp b/lib/Plugins/Kerneloops.cpp
index 5d041e0c..cf65c9ee 100644
--- a/lib/Plugins/Kerneloops.cpp
+++ b/lib/Plugins/Kerneloops.cpp
@@ -90,9 +90,7 @@ void CAnalyzerKerneloops::Report()
time_t t = time(NULL);
if (((time_t) -1) == t)
{
- fprintf(stderr, "Kerneloops: cannot get local time.\n");
- perror("");
- // TODO: throw -4
+ throw std::string("CAnalyzerKerneloops::Report(): cannot get local time.");
}
m_pOopsList = m_pSysLog.GetOopsList();
@@ -117,8 +115,7 @@ void CAnalyzerKerneloops::Report()
}
catch (std::string sError)
{
- fprintf(stderr, "Kerneloops: %s\n", sError.c_str());
- // TODO: throw -2
+ throw std::string("CAnalyzerKerneloops::Report(): ") + sError.c_str();
}
m_pOopsList.pop_back();
}
@@ -126,11 +123,14 @@ void CAnalyzerKerneloops::Report()
void CAnalyzerKerneloops::Init()
{
- /* hack: release Init() */
+ /* daemonize */
pid_t pid = fork();
+ if (pid < 0)
+ throw std::string("CAnalyzerKerneloops::Init(): fork failed.");
+
+ /* hack: release Init() */
if (pid)
return;
- // TODO: throw if we can't fork()
sched_yield();