diff options
| author | Andreas Schneider <asn@cryptomilk.org> | 2014-01-31 16:59:36 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2014-02-01 14:29:54 +0100 |
| commit | b136de00e4ac63d2d5359782912c89ebf073cbf1 (patch) | |
| tree | 7cc6b4bcc196f513437b6a44b67357e8fed12b60 /src | |
| parent | 81ece3533fa99b48b428870042246fb8dfdf36ad (diff) | |
| download | socket_wrapper-b136de00e4ac63d2d5359782912c89ebf073cbf1.tar.gz socket_wrapper-b136de00e4ac63d2d5359782912c89ebf073cbf1.tar.xz socket_wrapper-b136de00e4ac63d2d5359782912c89ebf073cbf1.zip | |
src: Add a public socket_wrapper_enabled() function.socket_wrapper-1.0.0
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/socket_wrapper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 6e38f32..c5b1fdf 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -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); } |
