From e6973a8909554c1b1d812f4f07d8806b87cad394 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 14 Mar 2012 14:49:21 -0400 Subject: [PATCH] fix: ustcomm_close_unix_sock should close, not shutdown .. and ensure that we actually use the API rather than doing the close() directly in the caller. Signed-off-by: Mathieu Desnoyers --- liblttng-ust-comm/lttng-ust-comm.c | 5 ++--- liblttng-ust/lttng-ust-comm.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 0781f4ce..b90f5fe7 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -301,10 +301,9 @@ int ustcomm_close_unix_sock(int sock) { int ret; - /* Shutdown receptions and transmissions */ - ret = shutdown(sock, SHUT_RDWR); + ret = close(sock); if (ret < 0) { - perror("shutdown"); + perror("close"); } return ret; diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index e19fa949..e3afe6af 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -396,7 +396,7 @@ void cleanup_sock_info(struct sock_info *sock_info, int exiting) int ret; if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing apps socket"); } @@ -676,7 +676,7 @@ restart: } if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing %s apps socket", sock_info->name); } -- 2.34.1