summaryrefslogtreecommitdiffstats
path: root/src/providers/child_common.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-05-21 11:09:11 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-05-27 14:44:14 -0400
commitd66944d34d4969c2ba1ed1495e2dda91af665156 (patch)
treeeb2df248bb9d26e50064f3db0635ab9b714311ff /src/providers/child_common.c
parent2892c3c025882d63559a3adc06f62c2ca4e4c55a (diff)
downloadsssd2-d66944d34d4969c2ba1ed1495e2dda91af665156.tar.gz
sssd2-d66944d34d4969c2ba1ed1495e2dda91af665156.tar.xz
sssd2-d66944d34d4969c2ba1ed1495e2dda91af665156.zip
Remove signal event if child was terminated by a signal
Diffstat (limited to 'src/providers/child_common.c')
-rw-r--r--src/providers/child_common.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/providers/child_common.c b/src/providers/child_common.c
index a8a4e040..a242338a 100644
--- a/src/providers/child_common.c
+++ b/src/providers/child_common.c
@@ -319,12 +319,28 @@ void child_sig_handler(struct tevent_context *ev,
DEBUG(1, ("waitpid failed [%d][%s].\n", err, strerror(err)));
} else if (ret == 0) {
DEBUG(1, ("waitpid did not found a child with changed status.\n"));
- } else if WIFEXITED(child_ctx->child_status) {
- if (WEXITSTATUS(child_ctx->child_status) != 0) {
- DEBUG(1, ("child [%d] failed with status [%d].\n", ret,
- child_ctx->child_status));
+ } else {
+ if WIFEXITED(child_ctx->child_status) {
+ if (WEXITSTATUS(child_ctx->child_status) != 0) {
+ DEBUG(1, ("child [%d] failed with status [%d].\n", ret,
+ WEXITSTATUS(child_ctx->child_status)));
+ } else {
+ DEBUG(4, ("child [%d] finished successfully.\n", ret));
+ }
+ } else if WIFSIGNALED(child_ctx->child_status) {
+ DEBUG(1, ("child [%d] was terminated by signal [%d].\n", ret,
+ WTERMSIG(child_ctx->child_status)));
} else {
- DEBUG(4, ("child [%d] finished successfully.\n", ret));
+ if WIFSTOPPED(child_ctx->child_status) {
+ DEBUG(7, ("child [%d] was stopped by signal [%d].\n", ret,
+ WSTOPSIG(child_ctx->child_status)));
+ }
+ if WIFCONTINUED(child_ctx->child_status) {
+ DEBUG(7, ("child [%d] was resumed by delivery of SIGCONT.\n",
+ ret));
+ }
+
+ return;
}
/* Invoke the callback in a tevent_immediate handler