summaryrefslogtreecommitdiffstats
path: root/src/cli/report.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-02-01 15:58:44 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-01 15:58:44 +0100
commit058e0d3144b32d048c2a7637447881256e4c9997 (patch)
tree4190e018528d9f2f9a4a05398468da5d8a0de526 /src/cli/report.cpp
parent876664f002c5f90e5722602956a6d60591619680 (diff)
downloadabrt-058e0d3144b32d048c2a7637447881256e4c9997.tar.gz
abrt-058e0d3144b32d048c2a7637447881256e4c9997.tar.xz
abrt-058e0d3144b32d048c2a7637447881256e4c9997.zip
use run_state->children_count == 0 check for "event not conf'd" condition
run_event_on_FOO() was returning -1 when it found that not even one program was run on the requested event. Which is not a very natural return value: in many cases this isn't an error. This change makes it return 0 in this case. It is ok since now we have run_state->children_count member which can be checked for 0 by those callers which want to detect this condition. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/cli/report.cpp')
-rw-r--r--src/cli/report.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/cli/report.cpp b/src/cli/report.cpp
index 56740e25..29c5e06f 100644
--- a/src/cli/report.cpp
+++ b/src/cli/report.cpp
@@ -637,9 +637,10 @@ static int run_events(const char *dump_dir_name,
std::string event = events[i];
int r = run_event_on_dir_name(run_state, dump_dir_name, event.c_str());
- if (r == -1)
+ if (r == 0 && run_state->children_count == 0)
{
l_state.last_line = xasprintf("Error: no processing is specified for event '%s'", event.c_str());
+ r = -1;
}
if (r == 0)
{
@@ -707,13 +708,7 @@ int run_analyze_event(const char *dump_dir_name)
run_state->logging_callback = do_log;
int res = run_event_on_dir_name(run_state, dump_dir_name, "analyze");
free_run_event_state(run_state);
-
- if (res != 0 && res != -1) /* -1 is "nothing was done", here it is ok */
- {
- error_msg("Error while running analyze event on '%s'", dump_dir_name);
- return 1;
- }
- return 0;
+ return res;
}