Build fix: missing cstdint include in futex.hpp
[lttng-tools.git] / src / common / unix.cpp
index 4861b8ea139ae64b10bb4c0328bafc56d08587cc..0548aaccbab6fccce6f98093cf7c98cceca4ebf7 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <common/common.h>
-#include <common/compat/errno.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/fd-handle.h>
+#include <common/common.hpp>
+#include <common/compat/errno.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/fd-handle.hpp>
 
-#include "unix.h"
+#include "unix.hpp"
 
 /*
  * Connect to unix socket using the path name.
@@ -379,7 +379,16 @@ int lttcomm_close_unix_sock(int sock)
        /* Shutdown receptions and transmissions */
        ret = shutdown(sock, SHUT_RDWR);
        if (ret < 0) {
-               PERROR("shutdown");
+               /*
+                * The socket is already disconnected, don't error out.
+                * This doesn't happen on Linux, but it does on FreeBSD, see:
+                * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227259
+                */
+               if (errno == ENOTCONN) {
+                       ret = 0;
+               } else {
+                       PERROR("shutdown");
+               }
        }
 
        closeret = close(sock);
This page took 0.023175 seconds and 4 git commands to generate.