fix: ustcomm_close_unix_sock should close, not shutdown
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 14 Mar 2012 18:49:21 +0000 (14:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 14 Mar 2012 18:49:21 +0000 (14:49 -0400)
.. and ensure that we actually use the API rather than doing the close()
directly in the caller.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-comm.c
liblttng-ust/lttng-ust-comm.c

index 0781f4cecb4408f0746d8e1f3586f740d09aae4a..b90f5fe7baa0f64f8374bed6e367d96939baa312 100644 (file)
@@ -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;
index e19fa949cbf69fd8cf70006898e8ddaa1796ca97..e3afe6af562cb8a22207ca90210b3450b8d2453d 100644 (file)
@@ -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);
                }
This page took 0.027406 seconds and 4 git commands to generate.