~yeban/libmemcached/todo-host.c

« back to all changes in this revision

Viewing changes to clients/memcapable.c

  • Committer: Brian Aker
  • Date: 2011-03-17 21:45:08 UTC
  • Revision ID: brian@tangent.org-20110317214508-ogufz6pusakvcch0
Merge in updates to make sure exit/return is done properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
623
623
                                    PROTOCOL_BINARY_RESPONSE_SUCCESS));
624
624
  }
625
625
 
626
 
  /* Socket should be closed now, read should return 0 */
 
626
  /* Socket should be closed now, read should return EXIT_SUCCESS */
627
627
  verify(timeout_io_op(sock, POLLIN, rsp.bytes, sizeof(rsp.bytes)) == 0);
628
628
 
629
629
  return TEST_PASS_RECONNECT;
1211
1211
  /* Verify that quit works */
1212
1212
  execute(send_string("quit\r\n"));
1213
1213
 
1214
 
  /* Socket should be closed now, read should return 0 */
 
1214
  /* Socket should be closed now, read should return EXIT_SUCCESS */
1215
1215
  char buffer[80];
1216
1216
  verify(timeout_io_op(sock, POLLIN, buffer, sizeof(buffer)) == 0);
1217
1217
  return TEST_PASS_RECONNECT;
1976
1976
      if (timeout == 0)
1977
1977
      {
1978
1978
        fprintf(stderr, "Invalid timeout. Please specify a number for -t\n");
1979
 
        return 1;
 
1979
        return EXIT_FAILURE;
1980
1980
      }
1981
1981
      break;
1982
1982
    case 'v': verbose= true;
2004
2004
              "\t-a\tOnly test the ascii protocol\n"
2005
2005
              "\t-b\tOnly test the binary protocol\n",
2006
2006
              argv[0]);
2007
 
      return 1;
 
2007
      return EXIT_FAILURE;
2008
2008
    }
2009
2009
  }
2010
2010
 
2014
2014
  {
2015
2015
    fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
2016
2016
            hostname, port, strerror(get_socket_errno()));
2017
 
    return 1;
 
2017
    return EXIT_FAILURE;
2018
2018
  }
2019
2019
 
2020
2020
  for (int ii= 0; testcases[ii].description != NULL; ++ii)
2072
2072
        fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
2073
2073
                hostname, port, strerror(get_socket_errno()));
2074
2074
        fprintf(stderr, "%d of %d tests failed\n", failed, total);
2075
 
        return 1;
 
2075
        return EXIT_FAILURE;
2076
2076
      }
2077
2077
    }
2078
2078
  }