diff options
-rw-r--r-- | infrastructure/buildenv-testmain-template.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index 488e8623..0de18255 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -29,10 +29,16 @@ #include <getopt.h> #endif -#include <sys/socket.h> +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif + #include <sys/stat.h> #include <sys/types.h> -#include <sys/un.h> + +#ifdef HAVE_SYS_UN_H +# include <sys/un.h> +#endif #include <exception> #include <string> @@ -113,6 +119,7 @@ bool check_filedes(bool report) char buffer[256]; socklen_t addrlen = sizeof(buffer); +#ifdef HAVE_GETPEERNAME if(getpeername(d, (sockaddr*)buffer, &addrlen) != 0) { BOX_WARNING("Failed to getpeername(" << @@ -128,6 +135,7 @@ bool check_filedes(bool report) is_syslog_socket = true; } } +#endif // HAVE_GETPEERNAME } if(report && filedes_open[d] != OPEN) |