diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-13 16:05:50 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-13 16:05:50 +0200 |
| commit | 407222babd840bcc935789dc441f6099f9d22412 (patch) | |
| tree | 443d21c220cd985877635cd5e1fa9aa171b40f6b /src | |
| parent | b6bc6d13eed2f346414d731ecb29579a719556f3 (diff) | |
| parent | 146b08ec6920405b608d7ec75c6ac49727cd4b68 (diff) | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
| -rw-r--r-- | src/Daemon/CrashWatcher.cpp | 34 | ||||
| -rw-r--r-- | src/Daemon/abrt.conf | 5 | ||||
| -rw-r--r-- | src/Hooks/CCpp.cpp | 1 |
3 files changed, 26 insertions, 14 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index f811501..ad497c9 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -198,28 +198,38 @@ void CCrashWatcher::SetUpCron() for (it_c = cron.begin(); it_c != cron.end(); it_c++) { std::string::size_type pos = it_c->first.find(":"); - std::string sH = it_c->first; - std::string sM = ""; + int timeout = 0; int nH = -1; int nM = -1; + int nS = -1; time_t actTime = time(NULL); if (pos != std::string::npos) { + std::string sH = ""; + std::string sM = ""; + sH = it_c->first.substr(0, pos); - sM = it_c->first.substr(pos + 1); - } - int timeout = 0; - if (sH != "*") - { nH = atoi(sH.c_str()); - timeout = nH * 60 * 60; + nH = nH > 23 ? 23 : nH; + nH = nH < 0 ? 0 : nH; + nM = nM > 59 ? 59 : nM; + nM = nM < 0 ? 0 : nM; + timeout += nH * 60 * 60; + sM = it_c->first.substr(pos + 1); + nM = atoi(sM.c_str()); + timeout += nM * 60; } - if (sM != "*") + else { - nM = atoi(sM.c_str()); - timeout = nM * 60; + std::string sS = ""; + + sS = it_c->first; + nS = atoi(sS.c_str()); + nS = nS < 0 ? 0 : nS; + timeout = nS; } - if (nH == -1 || nM == -1) + + if (nS != -1) { CSettings::vector_pair_strings_t::iterator it_ar; for (it_ar = it_c->second.begin(); it_ar != it_c->second.end(); it_ar++) diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index d059a9e..1739509 100644 --- a/src/Daemon/abrt.conf +++ b/src/Daemon/abrt.conf @@ -26,5 +26,6 @@ CCpp = Logger # repeated calling of Action plugins [ Cron ] -# hh,mm -*:1 = KerneloopsScanner +# h:m - at h:m an action plugin is activated +# s - every s seconds is an action plugin activated +10 = KerneloopsScanner diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 05e0b56..84d023d 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -142,6 +142,7 @@ int main(int argc, char** argv) dd.SaveText(FILENAME_EXECUTABLE, executable); dd.SaveText(FILENAME_UID, uid); dd.SaveText(FILENAME_CMDLINE, cmdline); + dd.SaveText(FILENAME_REASON, std::string("Process was terminated by signal ") + signal); snprintf(path + strlen(path), sizeof(path), "/%s", FILENAME_COREDUMP); |
