diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-01 15:58:44 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-01 15:58:44 +0100 |
| commit | 058e0d3144b32d048c2a7637447881256e4c9997 (patch) | |
| tree | 4190e018528d9f2f9a4a05398468da5d8a0de526 /src/daemon/MiddleWare.cpp | |
| parent | 876664f002c5f90e5722602956a6d60591619680 (diff) | |
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/daemon/MiddleWare.cpp')
| -rw-r--r-- | src/daemon/MiddleWare.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp index 8b8795a2..906b1464 100644 --- a/src/daemon/MiddleWare.cpp +++ b/src/daemon/MiddleWare.cpp @@ -147,7 +147,7 @@ static mw_result_t CreateCrashReport(const char *dump_dir_name, run_state->logging_callback = do_log_and_update_client; res = run_event_on_dir_name(run_state, dump_dir_name, force ? "reanalyze" : "analyze"); free_run_event_state(run_state); - if (res != 0 && res != -1) /* -1 is "nothing was done", here it is ok */ + if (res != 0) { r = MW_PLUGIN_ERROR; goto ret; @@ -317,9 +317,10 @@ report_status_t Report(crash_data_t *client_report, l_state.last_line = NULL; 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) { |
