Commit b136de00 authored by Andreas Schneider's avatar Andreas Schneider

src: Add a public socket_wrapper_enabled() function.

Reviewed-by: 's avatarJeremy Allison <jra@samba.org>
parent 81ece353
......@@ -221,6 +221,7 @@ struct socket_info *sockets;
/* Function prototypes */
bool socket_wrapper_enabled(void);
void swrap_destructor(void) DESTRUCTOR_ATTRIBUTE;
#ifdef NDEBUG
......@@ -806,6 +807,13 @@ static const char *socket_wrapper_dir(void)
return s;
}
bool socket_wrapper_enabled(void)
{
const char *s = socket_wrapper_dir();
return s != NULL ? true : false;
}
static unsigned int socket_wrapper_default_iface(void)
{
const char *s = getenv("SOCKET_WRAPPER_DEFAULT_IFACE");
......@@ -2063,7 +2071,7 @@ static int swrap_socket(int family, int type, int protocol)
real_type &= ~SOCK_NONBLOCK;
#endif
if (socket_wrapper_dir() == NULL) {
if (!socket_wrapper_enabled()) {
return libc_socket(family, type, protocol);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment