Remove dead code
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
parent
3c0b86df9c
commit
a2aab8eab2
6 changed files with 4 additions and 88 deletions
|
@ -535,18 +535,6 @@ int rtps_config_prep (struct cfgst *cfgst)
|
||||||
goto err_config_late_error;
|
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
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
{
|
{
|
||||||
/* Determine number of configured channels to be able to
|
/* Determine number of configured channels to be able to
|
||||||
|
|
|
@ -17,10 +17,6 @@
|
||||||
|
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#include <netdb.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ddsi/q_log.h"
|
#include "ddsi/q_log.h"
|
||||||
#include "ddsi/q_nwif.h"
|
#include "ddsi/q_nwif.h"
|
||||||
#include "ddsi/q_globals.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));
|
memcpy (&id, src->address + 12, sizeof (id));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if OS_SOCKET_HAS_IPV6
|
||||||
md5_state_t st;
|
md5_state_t st;
|
||||||
md5_byte_t digest[16];
|
md5_byte_t digest[16];
|
||||||
md5_init (&st);
|
md5_init (&st);
|
||||||
md5_append (&st, (const md5_byte_t *) ((const os_sockaddr_in6 *) src)->sin6_addr.s6_addr, 16);
|
md5_append (&st, (const md5_byte_t *) ((const os_sockaddr_in6 *) src)->sin6_addr.s6_addr, 16);
|
||||||
md5_finish (&st, digest);
|
md5_finish (&st, digest);
|
||||||
memcpy (&id, digest, sizeof (id));
|
memcpy (&id, digest, sizeof (id));
|
||||||
|
#else
|
||||||
|
DDS_FATAL("IPv6 unavailable\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,31 +186,6 @@ extern "C" {
|
||||||
const char *format,
|
const char *format,
|
||||||
va_list args);
|
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
|
/** \brief strtoll wrapper
|
||||||
*
|
*
|
||||||
* Translate string str to long long value considering base,
|
* Translate string str to long long value considering base,
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
* \brief Initialization / Deinitialization
|
* \brief Initialization / Deinitialization
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/utsname.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
|
|
||||||
|
|
|
@ -58,42 +58,6 @@ os_vsnprintf(
|
||||||
return vsnprintf(str, size, format, args);
|
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)
|
ssize_t os_write(int fd, const void *buf, size_t count)
|
||||||
{
|
{
|
||||||
return write(fd, buf, count);
|
return write(fd, buf, count);
|
||||||
|
|
|
@ -88,16 +88,6 @@ os_putenv(
|
||||||
return result;
|
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 )
|
#pragma warning( disable : 4996 )
|
||||||
int
|
int
|
||||||
os_vsnprintf(
|
os_vsnprintf(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue