From: Mathieu Desnoyers Date: Wed, 14 Mar 2012 18:49:21 +0000 (-0400) Subject: fix: ustcomm_close_unix_sock should close, not shutdown X-Git-Tag: v2.0.0-rc3~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e6973a8909554c1b1d812f4f07d8806b87cad394;p=lttng-ust.git 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 --- 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); }