Refactor out item specific bits of the testing framework.
[m6w6/libmemcached] / libtest / port.cc
index 152d8360be12d51e4d09409c0be7c97520cb921a..fefb6a6d394ada0c72b0c480b61b7b38c140a406 100644 (file)
@@ -19,6 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <config.h>
 #include <libtest/common.h>
 
 #include <cassert>
@@ -100,7 +101,6 @@ in_port_t get_free_port()
           if (getsockname(sd, (struct sockaddr *)&sin, &addrlen) != -1)
           {
             ret_port= sin.sin_port;
-            Error << ret_port;
           }
         }
       }
@@ -117,7 +117,7 @@ in_port_t get_free_port()
   // We handle the case where if we max out retries, we still abort.
   if (ret_port <= 1024)
   {
-    abort();
+    fatal_message("No port could be found");
   }
 
   return ret_port;