diff options
author | Shantanu Goel <sgoel@trade4.test-jc.tower-research.com> | 2012-06-18 08:49:10 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-18 14:39:07 -0400 |
commit | 0664e450bd30db4c316f514ae79a2eef94d85c61 (patch) | |
tree | eaa70481ae08de410bc0edc3875e6c4c2c07f851 /src/responder/common | |
parent | f415f0af2560880a4eca5c39fdd0d3158094c8f1 (diff) | |
download | sssd-0664e450bd30db4c316f514ae79a2eef94d85c61.tar.gz sssd-0664e450bd30db4c316f514ae79a2eef94d85c61.tar.xz sssd-0664e450bd30db4c316f514ae79a2eef94d85c61.zip |
Log message if close() fails in destructor.
Diffstat (limited to 'src/responder/common')
-rw-r--r-- | src/responder/common/responder_common.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index af7a99efd..86582f587 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -90,7 +90,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; } |