Add in better testing for gdb.
[m6w6/libmemcached] / example / memcached_light.cc
index 4bf828250e27787b8a6b3e105da0ea7d46260a63..e7f952eacee1a1d3633cdfbbdcc0313eb63873f8 100644 (file)
@@ -433,13 +433,6 @@ int main(int argc, char **argv)
 {
   memcached_binary_protocol_callback_st *interface= &interface_v0_impl;
 
-  /*
-   * We need to initialize the handlers manually due to a bug in the
-   * warnings generated by struct initialization in gcc (all the way up to 4.4)
-   */
-  initialize_interface_v0_handler();
-  initialize_interface_v1_handler();
-
   {
     enum long_option_t {
       OPT_HELP,
@@ -554,6 +547,14 @@ int main(int argc, char **argv)
   util::log_info_st log_file(argv[0], global_options.log_file, false);
   log_file.write(util::VERBOSE_NOTICE, "starting log");
 
+  /*
+   * We need to initialize the handlers manually due to a bug in the
+   * warnings generated by struct initialization in gcc (all the way up to 4.4)
+   */
+  initialize_interface_v0_handler(log_file);
+  initialize_interface_v1_handler(log_file);
+
+
   if (server_socket(log_file, global_options.service) == false)
   {
     return EXIT_FAILURE;
@@ -624,7 +625,7 @@ int main(int argc, char **argv)
 
 
   /* Serve all of the clients */
-  switch (event_base_loop(event_base, 0) == -1)
+  switch (event_base_loop(event_base, 0))
   {
   case -1:
     log_file.write(util::VERBOSE_ERROR, "event_base_loop() failed");