From 26a0f776d32d0d5be2e15abe781adf5a830c24cc Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <dvlasenk@redhat.com>
Date: Wed, 7 Dec 2011 14:14:56 +0100
Subject: [PATCH 4/5] abrtd: always explain why we delete "corrupted" dir.
Closes rhbz#706131.
We were almost always explaining it, except for the case when
'post-create' was failing silently.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
---
src/daemon/abrtd.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
index 743e40f..b5c3d4b 100644
--- a/src/daemon/abrtd.c
+++ b/src/daemon/abrtd.c
@@ -313,14 +313,24 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
/* Prevent having zombie child process */
int status;
safe_waitpid(child, &status, 0);
- /* status = WEXITSTATUS(status); - wrong, we need to check WIFEXITED too */
/* exit 0 means "this is a good, non-dup dir" */
/* exit with 1 + "DUP_OF_DIR: dir" string => dup */
if (status != 0)
{
+ if (WIFSIGNALED(status))
+ {
+ log("'post-create' on '%s' killed by signal %d",
+ dump_dir_name, WTERMSIG(status));
+ return MW_ERROR;
+ }
+ /* else: it is WIFEXITED(status) */
if (!dup_of_dir)
+ {
+ log("'post-create' on '%s' exited with %d",
+ dump_dir_name, WEXITSTATUS(status));
return MW_ERROR;
+ }
dump_dir_name = dup_of_dir;
}
--
1.7.7.3