X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Funix.cpp;h=0548aaccbab6fccce6f98093cf7c98cceca4ebf7;hb=c29d17cd2d85f6ee89037377cc33821829529867;hp=0a1b1a5a54354beb1b759a7a95d6b6953d340ed2;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/src/common/unix.cpp b/src/common/unix.cpp index 0a1b1a5a5..0548aaccb 100644 --- a/src/common/unix.cpp +++ b/src/common/unix.cpp @@ -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);