From a84bc449fe75cd50580dff18ed63b864b48659d2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 6 Dec 2014 15:40:02 +0000 Subject: Remove unused code. --- infrastructure/buildenv-testmain-template.cpp | 19 ++++++++++++------- 1 file 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 #include +#ifdef HAVE_NETDB_H +# include +#endif + #ifdef HAVE_SYS_SOCKET_H # include #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 -- cgit v1.2.3