summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShantanu Goel <sgoel@trade4.test-jc.tower-research.com>2012-06-18 08:49:10 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-06-18 14:40:58 -0400
commit2494f364607af83b9599b36d5b8766e80e856ad9 (patch)
treebf872eec178c4a47bc2b4131f5c2c0525e82244d
parentf11c6cec5ed2a651446345dc05efabe54dfb652b (diff)
downloadsssd-2494f364607af83b9599b36d5b8766e80e856ad9.tar.gz
sssd-2494f364607af83b9599b36d5b8766e80e856ad9.tar.xz
sssd-2494f364607af83b9599b36d5b8766e80e856ad9.zip
Log message if close() fails in destructor.
-rw-r--r--src/responder/common/responder_common.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index b918bebb2..62c54faf0 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -87,7 +87,18 @@ static errno_t set_close_on_exec(int fd)
static int client_destructor(struct cli_ctx *ctx)
{
- if (ctx->cfd > 0) close(ctx->cfd);
+ errno_t ret;
+
+ if ((ctx->cfd > 0) && close(ctx->cfd) < 0) {
+ ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Failed to close fd [%d]: [%s]\n",
+ ctx->cfd, strerror(ret)));
+ }
+
+ DEBUG(SSSDBG_TRACE_INTERNAL,
+ ("Terminated client [%p][%d]\n",
+ ctx, ctx->cfd));
return 0;
}