diff --git a/src/core/ddsi/src/q_init.c b/src/core/ddsi/src/q_init.c index c7469e2..b3600f7 100644 --- a/src/core/ddsi/src/q_init.c +++ b/src/core/ddsi/src/q_init.c @@ -535,18 +535,6 @@ int rtps_config_prep (struct cfgst *cfgst) goto err_config_late_error; } -#if ! OS_SOCKET_HAS_IPV6 - /* If the platform doesn't support IPv6, guarantee useIpv6 is - false. There are two ways of going about it, one is to do it - silently, the other to let the user fix his config. Clearly, we - have chosen the latter. */ - if (config.useIpv6) - { - DDS_ERROR("IPv6 addressing requested but not supported on this platform\n"); - goto err_config_late_error; - } -#endif - #ifdef DDSI_INCLUDE_NETWORK_CHANNELS { /* Determine number of configured channels to be able to diff --git a/src/core/ddsi/src/q_nwif.c b/src/core/ddsi/src/q_nwif.c index d1a4cc3..cf1879e 100644 --- a/src/core/ddsi/src/q_nwif.c +++ b/src/core/ddsi/src/q_nwif.c @@ -17,10 +17,6 @@ #include "os/os.h" -#ifndef _WIN32 -#include -#endif - #include "ddsi/q_log.h" #include "ddsi/q_nwif.h" #include "ddsi/q_globals.h" @@ -46,12 +42,16 @@ unsigned locator_to_hopefully_unique_uint32 (const nn_locator_t *src) memcpy (&id, src->address + 12, sizeof (id)); else { +#if OS_SOCKET_HAS_IPV6 md5_state_t st; md5_byte_t digest[16]; md5_init (&st); md5_append (&st, (const md5_byte_t *) ((const os_sockaddr_in6 *) src)->sin6_addr.s6_addr, 16); md5_finish (&st, digest); memcpy (&id, digest, sizeof (id)); +#else + DDS_FATAL("IPv6 unavailable\n"); +#endif } return id; } diff --git a/src/os/include/os/os_stdlib.h b/src/os/include/os/os_stdlib.h index 2032a63..bc4ce19 100644 --- a/src/os/include/os/os_stdlib.h +++ b/src/os/include/os/os_stdlib.h @@ -186,31 +186,6 @@ extern "C" { const char *format, va_list args); - /** \brief fprintf wrapper with disabled broken pipe signals - * - * A fprintf can cause an broken pipe signal that can result in a deadlock - * if the interrupted thread is holding recourses needed by for example the - * signal handler thread. - * - * Precondition: - * None - * Postcondition: - * None - * - * Possible results: - * - return - * Upon successful completion will return the number of - * bytes written to file - * or a negative value if an error occurred. - * errno will be set in such case - * - Writes formatted output to file. - */ - int - os_vfprintfnosigpipe( - FILE *file, - const char *format, - va_list args); - /** \brief strtoll wrapper * * Translate string str to long long value considering base, diff --git a/src/os/src/posix/os_platform_init.c b/src/os/src/posix/os_platform_init.c index 0ab4b10..47cb845 100644 --- a/src/os/src/posix/os_platform_init.c +++ b/src/os/src/posix/os_platform_init.c @@ -17,7 +17,6 @@ * \brief Initialization / Deinitialization */ -#include #include #include "os/os.h" diff --git a/src/os/src/snippets/code/os_stdlib.c b/src/os/src/snippets/code/os_stdlib.c index 239fa45..9787e2f 100644 --- a/src/os/src/snippets/code/os_stdlib.c +++ b/src/os/src/snippets/code/os_stdlib.c @@ -58,42 +58,6 @@ os_vsnprintf( return vsnprintf(str, size, format, args); } -int -os_vfprintfnosigpipe( - FILE *file, - const char *format, - va_list args) -{ - int result; - - sigset_t sset_before, sset_omask, sset_pipe, sset_after; - - sigemptyset(&sset_pipe); - sigaddset(&sset_pipe, SIGPIPE); - sigpending(&sset_before); - pthread_sigmask(SIG_BLOCK, &sset_pipe, &sset_omask); - result = vfprintf(file, format, args); - sigpending(&sset_after); - if (!sigismember(&sset_before, SIGPIPE) && sigismember(&sset_after, SIGPIPE)) { - /* sigtimedwait appears to be fairly well supported, just not by Mac OS. If other platforms prove to be a problem, we can do a proper indication of platform support in the os defs. The advantage of sigtimedwait is that it protects against a deadlock when SIGPIPE is sent from outside the program and all threads have it blocked. In any case, when SIGPIPE is sent in this manner and we consume the signal here, the signal is lost. Nobody should be abusing system-generated signals in this manner. */ -#ifndef __APPLE__ - struct timespec timeout = { 0, 0 }; - sigtimedwait(&sset_pipe, NULL, &timeout); -#else - int sig; - sigwait(&sset_pipe, &sig); -#endif -#ifndef NDEBUG - sigpending(&sset_after); - assert(!sigismember(&sset_after, SIGPIPE)); -#endif - os_setErrno(EPIPE); - result = -1; - } - pthread_sigmask(SIG_SETMASK, &sset_omask, NULL); - return result; -} - ssize_t os_write(int fd, const void *buf, size_t count) { return write(fd, buf, count); diff --git a/src/os/src/windows/os_platform_stdlib.c b/src/os/src/windows/os_platform_stdlib.c index 343ea0c..3de5b40 100644 --- a/src/os/src/windows/os_platform_stdlib.c +++ b/src/os/src/windows/os_platform_stdlib.c @@ -88,16 +88,6 @@ os_putenv( return result; } -#pragma warning( disable : 4996 ) -int -os_vfprintfnosigpipe( - FILE *file, - const char *format, - va_list args) -{ - return vfprintf(file, format, args); -} - #pragma warning( disable : 4996 ) int os_vsnprintf(