[tarantool-patches] Re: [PATCH] Enable support for NOTIFY_SOCKET on macOS

Maxim Melentiev dmarc-noreply at freelists.org
Thu Aug 22 11:59:22 MSK 2019


Does this work as you expect? Is there any reason to expose 
HAVE_MSG_NOSIGNAL to C code?

option(WITH_NOTIFY_SOCKET "Enable notifications on NOTIFY_SOCKET" ON)

if (WITH_SYSTEMD AND NOT WITH_NOTIFY_SOCKET)
     message(FATAL_ERROR "WITH_NOTIFY_SOCKET must be enabled when 
WITH_SYSTEMD enabled")
endif()

if (WITH_NOTIFY_SOCKET)
     # Linux supports MSG_NOSIGNAL flag for sendmsg.
     # macOS lacks it, but has SO_NOSIGPIPE for setsockopt
     # to achieve same behavior.
     CHECK_C_SOURCE_COMPILES("
         #include <sys/types.h>
         #include <sys/socket.h>
         int main(){ return MSG_NOSIGNAL; }
     " HAVE_MSG_NOSIGNAL)
     CHECK_C_SOURCE_COMPILES("
         #include <sys/types.h>
         #include <sys/socket.h>
         int main(){ return SO_NOSIGPIPE; }
     " HAVE_SO_NOSIGPIPE)
     if (NOT HAVE_MSG_NOSIGNAL AND NOT HAVE_SO_NOSIGPIPE)
         message(FATAL_ERROR
             "No way to block SIGPIPE in sendmsg. Can not compile with 
WITH_NOTIFY_SOCKET"
         )
     endif()
endif()

And C code uses #ifdef SO_NOSIGPIP, #ifdef MSG_NOSIGNAL

On 21/08/2019 18:52, Konstantin Osipov wrote:
> * Maxim Melentiev <m.melentiev at corp.mail.ru> [19/08/21 11:32]:
>
> this doesn't address my review.
>
> If you disagree with the review, please reply to it. Otherwise
> there is no point in sending a new patch.
>




More information about the Tarantool-patches mailing list