diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 15:40:02 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 15:40:02 +0000 |
commit | a84bc449fe75cd50580dff18ed63b864b48659d2 (patch) | |
tree | 1bd9d1229e82f9a03d4fab012ae8c571dad7f63e /infrastructure | |
parent | d2afea0af9291bd0d6967c6b8b418541c3c28f64 (diff) |
Remove unused code.
Diffstat (limited to 'infrastructure')
-rw-r--r-- | infrastructure/buildenv-testmain-template.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index e5392d66..8b052c32 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -25,6 +25,10 @@ #include <stdio.h> #include <unistd.h> +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif + #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif @@ -121,7 +125,7 @@ bool check_filedes(bool report) #ifdef HAVE_GETPEERNAME if(getpeername(d, (sockaddr*)buffer, &addrlen) != 0) { - BOX_WARNING("Failed to getpeername(" << + BOX_LOG_SYS_WARNING("Failed to getpeername(" << d << "), cannot identify /dev/log"); } else @@ -230,12 +234,6 @@ int main(int argc, char * const * argv) Logging::SetProgramName(BOX_MODULE); - #ifdef BOX_RELEASE_BUILD - int logLevel = Log::NOTICE; // need an int to do math with - #else - int logLevel = Log::INFO; // need an int to do math with - #endif - struct option longopts[] = { { "bbackupd-args", required_argument, NULL, 'c' }, @@ -317,6 +315,13 @@ int main(int argc, char * const * argv) // Count open file descriptors for a very crude "files left open" test Logging::GetSyslog().Shutdown(); + + // On NetBSD, gethostbyname() appears to open a kqueue socket + // and it's not clear how to close it again. So let's just do + // it once, before counting fds for the first time, so that it's + // already open and doesn't count as a leak. + ::gethostbyname("localhost"); + check_filedes(false); #ifdef WIN32 |