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:37:59 -0400 |
commit | 3adb3a4ed740aaeb3013020aa8aa9544669197a0 (patch) | |
tree | 792979ab874b1cc5ac7f58e666847fa5207738b0 /src | |
parent | ffe862eb84ca64c12920333af29ce02dd416d148 (diff) | |
download | sssd-3adb3a4ed740aaeb3013020aa8aa9544669197a0.tar.gz sssd-3adb3a4ed740aaeb3013020aa8aa9544669197a0.tar.bz2 sssd-3adb3a4ed740aaeb3013020aa8aa9544669197a0.zip |
Log message if close() fails in destructor.
Diffstat (limited to 'src')
-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 2e3e98a9..5d524880 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; } |