projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
d4f3d77
)
Merge in updates to make sure exit/return is done properly.
author
Brian Aker
<brian@tangent.org>
Thu, 17 Mar 2011 21:45:08 +0000
(14:45 -0700)
committer
Brian Aker
<brian@tangent.org>
Thu, 17 Mar 2011 21:45:08 +0000
(14:45 -0700)
28 files changed:
clients/execute.c
patch
|
blob
|
history
clients/memcapable.c
patch
|
blob
|
history
clients/memcat.c
patch
|
blob
|
history
clients/memcp.c
patch
|
blob
|
history
clients/memdump.c
patch
|
blob
|
history
clients/memerror.c
patch
|
blob
|
history
clients/memflush.c
patch
|
blob
|
history
clients/memrm.c
patch
|
blob
|
history
clients/memslap.c
patch
|
blob
|
history
clients/ms_conn.c
patch
|
blob
|
history
clients/ms_setting.c
patch
|
blob
|
history
clients/ms_sigsegv.c
patch
|
blob
|
history
clients/ms_task.c
patch
|
blob
|
history
clients/ms_thread.c
patch
|
blob
|
history
example/memcached_light.c
patch
|
blob
|
history
libhashkit/digest.c
patch
|
blob
|
history
libhashkit/hsieh.c
patch
|
blob
|
history
libhashkit/ketama.c
patch
|
blob
|
history
libmemcached/behavior.c
patch
|
blob
|
history
libmemcached/hash.c
patch
|
blob
|
history
libmemcached/hosts.c
patch
|
blob
|
history
libmemcached/io.c
patch
|
blob
|
history
libmemcached/protocol/ascii_handler.c
patch
|
blob
|
history
libmemcached/util/pool.c
patch
|
blob
|
history
libtest/test.c
patch
|
blob
|
history
tests/atomsmasher.c
patch
|
blob
|
history
tests/cpp_example.cc
patch
|
blob
|
history
tests/start.c
patch
|
blob
|
history
diff --git
a/clients/execute.c
b/clients/execute.c
index 0beaae4bd85229208b704568dac68f854ca435f2..dbc102c68af0f062501dfead9e98e9c6be6fb49b 100644
(file)
--- a/
clients/execute.c
+++ b/
clients/execute.c
@@
-116,7
+116,7
@@
unsigned int execute_mget(memcached_st *memc,
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
- return
0
;
+ return
EXIT_SUCCESS
;
}
}
else
}
}
else
@@
-124,7
+124,7
@@
unsigned int execute_mget(memcached_st *memc,
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
- return
0
;
+ return
EXIT_SUCCESS
;
}
return retrieved;
}
return retrieved;
diff --git
a/clients/memcapable.c
b/clients/memcapable.c
index fdbc35c8d4bb33624c0c72b37735f2da0b9ac188..69d2557ea959608a0702a2494971595cd17cb313 100644
(file)
--- a/
clients/memcapable.c
+++ b/
clients/memcapable.c
@@
-623,7
+623,7
@@
static enum test_return test_binary_quit_impl(uint8_t cc)
PROTOCOL_BINARY_RESPONSE_SUCCESS));
}
PROTOCOL_BINARY_RESPONSE_SUCCESS));
}
- /* Socket should be closed now, read should return
0
*/
+ /* Socket should be closed now, read should return
EXIT_SUCCESS
*/
verify(timeout_io_op(sock, POLLIN, rsp.bytes, sizeof(rsp.bytes)) == 0);
return TEST_PASS_RECONNECT;
verify(timeout_io_op(sock, POLLIN, rsp.bytes, sizeof(rsp.bytes)) == 0);
return TEST_PASS_RECONNECT;
@@
-1211,7
+1211,7
@@
static enum test_return test_ascii_quit(void)
/* Verify that quit works */
execute(send_string("quit\r\n"));
/* Verify that quit works */
execute(send_string("quit\r\n"));
- /* Socket should be closed now, read should return
0
*/
+ /* Socket should be closed now, read should return
EXIT_SUCCESS
*/
char buffer[80];
verify(timeout_io_op(sock, POLLIN, buffer, sizeof(buffer)) == 0);
return TEST_PASS_RECONNECT;
char buffer[80];
verify(timeout_io_op(sock, POLLIN, buffer, sizeof(buffer)) == 0);
return TEST_PASS_RECONNECT;
@@
-1976,7
+1976,7
@@
int main(int argc, char **argv)
if (timeout == 0)
{
fprintf(stderr, "Invalid timeout. Please specify a number for -t\n");
if (timeout == 0)
{
fprintf(stderr, "Invalid timeout. Please specify a number for -t\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
break;
case 'v': verbose= true;
}
break;
case 'v': verbose= true;
@@
-2004,7
+2004,7
@@
int main(int argc, char **argv)
"\t-a\tOnly test the ascii protocol\n"
"\t-b\tOnly test the binary protocol\n",
argv[0]);
"\t-a\tOnly test the ascii protocol\n"
"\t-b\tOnly test the binary protocol\n",
argv[0]);
- return
1
;
+ return
EXIT_FAILURE
;
}
}
}
}
@@
-2014,7
+2014,7
@@
int main(int argc, char **argv)
{
fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
hostname, port, strerror(get_socket_errno()));
{
fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
hostname, port, strerror(get_socket_errno()));
- return
1
;
+ return
EXIT_FAILURE
;
}
for (int ii= 0; testcases[ii].description != NULL; ++ii)
}
for (int ii= 0; testcases[ii].description != NULL; ++ii)
@@
-2072,7
+2072,7
@@
int main(int argc, char **argv)
fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
hostname, port, strerror(get_socket_errno()));
fprintf(stderr, "%d of %d tests failed\n", failed, total);
fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
hostname, port, strerror(get_socket_errno()));
fprintf(stderr, "%d of %d tests failed\n", failed, total);
- return
1
;
+ return
EXIT_FAILURE
;
}
}
}
}
}
}
diff --git
a/clients/memcat.c
b/clients/memcat.c
index 5c7a512f2763e9b2214c610f8be841e83d5b731c..8998ff0cd676e2c1a5a829c26339e1d9c2a4842a 100644
(file)
--- a/
clients/memcat.c
+++ b/
clients/memcat.c
@@
-76,7
+76,7
@@
int main(int argc, char *argv[])
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return
1
;
+ return
EXIT_FAILURE
;
}
while (optind < argc)
}
while (optind < argc)
diff --git
a/clients/memcp.c
b/clients/memcp.c
index 5b0518e7caa63b4c94d0efb4a79794391f2519db..bce35ce6d3ddebcd34474620695f3e0602d2cf24 100644
(file)
--- a/
clients/memcp.c
+++ b/
clients/memcp.c
@@
-63,13
+63,13
@@
static long strtol_wrapper(const char *nptr, int base, bool *error)
|| (errno != 0 && val == 0))
{
*error= true;
|| (errno != 0 && val == 0))
{
*error= true;
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (endptr == nptr)
{
*error= true;
}
if (endptr == nptr)
{
*error= true;
- return
0
;
+ return
EXIT_SUCCESS
;
}
*error= false;
}
*error= false;
@@
-117,7
+117,7
@@
int main(int argc, char *argv[])
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return
1
;
+ return
EXIT_FAILURE
;
}
while (optind < argc)
}
while (optind < argc)
diff --git
a/clients/memdump.c
b/clients/memdump.c
index 3b8027fd95d116933307d534d2627fa3faba18f5..67a2a5400508240c4c8d42fff55f2067d05f2bec 100644
(file)
--- a/
clients/memdump.c
+++ b/
clients/memdump.c
@@
-92,7
+92,7
@@
int main(int argc, char *argv[])
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return
1
;
+ return
EXIT_FAILURE
;
}
rc= memcached_dump(memc, callbacks, NULL, 1);
}
rc= memcached_dump(memc, callbacks, NULL, 1);
@@
-114,7
+114,7
@@
int main(int argc, char *argv[])
shutdown_sasl();
shutdown_sasl();
- return
0
;
+ return
EXIT_SUCCESS
;
}
static void options_parse(int argc, char *argv[])
}
static void options_parse(int argc, char *argv[])
diff --git
a/clients/memerror.c
b/clients/memerror.c
index 1ac091186f67f57436ce0041f1bc4226c2274675..c30dd2e9d9f69ab307d05b98672f4da95150082b 100644
(file)
--- a/
clients/memerror.c
+++ b/
clients/memerror.c
@@
-35,7
+35,7
@@
int main(int argc, char *argv[])
options_parse(argc, argv);
if (argc != 2)
options_parse(argc, argv);
if (argc != 2)
- return
1
;
+ return
EXIT_FAILURE
;
value= strtoul(argv[1], (char **) NULL, 10);
value= strtoul(argv[1], (char **) NULL, 10);
@@
-46,10
+46,10
@@
int main(int argc, char *argv[])
else
{
fprintf(stderr, "Unknown Error Code\n");
else
{
fprintf(stderr, "Unknown Error Code\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
}
}
diff --git
a/clients/memflush.c
b/clients/memflush.c
index 9f2b57c65ff9ba2fff11ba793a1b31d274316f64..813bf9e133e38cd9ff0c42f41a1fce442b1b8a85 100644
(file)
--- a/
clients/memflush.c
+++ b/
clients/memflush.c
@@
-63,7
+63,7
@@
int main(int argc, char *argv[])
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return
1
;
+ return
EXIT_FAILURE
;
}
rc = memcached_flush(memc, opt_expire);
}
rc = memcached_flush(memc, opt_expire);
@@
-82,7
+82,7
@@
int main(int argc, char *argv[])
shutdown_sasl();
shutdown_sasl();
- return
0
;
+ return
EXIT_SUCCESS
;
}
}
diff --git
a/clients/memrm.c
b/clients/memrm.c
index 5ba5cdcd49f862be4e13e2146f2815066184ff7c..8023a6387e4d07ffad09b7978c0d963a23de8837 100644
(file)
--- a/
clients/memrm.c
+++ b/
clients/memrm.c
@@
-68,7
+68,7
@@
int main(int argc, char *argv[])
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return
1
;
+ return
EXIT_FAILURE
;
}
while (optind < argc)
}
while (optind < argc)
diff --git
a/clients/memslap.c
b/clients/memslap.c
index 94048802f4be7a60b3edbfee3f1a176558437aeb..37e93ec3f9efa3eb15c42ff6b6c0be402982062c 100644
(file)
--- a/
clients/memslap.c
+++ b/
clients/memslap.c
@@
-659,7
+659,7
@@
static int ms_check_para()
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_check_para */
} /* ms_check_para */
@@
-904,5
+904,5
@@
int main(int argc, char *argv[])
ms_global_struct_destroy();
ms_setting_cleanup();
ms_global_struct_destroy();
ms_setting_cleanup();
- return
0
;
+ return
EXIT_SUCCESS
;
} /* main */
} /* main */
diff --git
a/clients/ms_conn.c
b/clients/ms_conn.c
index ae3145f5ae170c412b998e22d6f6b7d23ee7781e..e7ee3f1211eb547d4cb1b5c0f7f234cd0923bd68 100644
(file)
--- a/
clients/ms_conn.c
+++ b/
clients/ms_conn.c
@@
-224,7
+224,7
@@
static void ms_task_init(ms_conn_t *c)
* @param c, pointer of the concurrency
* @param is_udp, whether it's udp
*
* @param c, pointer of the concurrency
* @param is_udp, whether it's udp
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_conn_udp_init(ms_conn_t *c, const bool is_udp)
{
*/
static int ms_conn_udp_init(ms_conn_t *c, const bool is_udp)
{
@@
-260,7
+260,7
@@
static int ms_conn_udp_init(ms_conn_t *c, const bool is_udp)
memset(c->udppkt, 0, MAX_UDP_PACKET * sizeof(ms_udppkt_t));
}
memset(c->udppkt, 0, MAX_UDP_PACKET * sizeof(ms_udppkt_t));
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_conn_udp_init */
} /* ms_conn_udp_init */
@@
-272,7
+272,7
@@
static int ms_conn_udp_init(ms_conn_t *c, const bool is_udp)
* @param read_buffer_size
* @param is_udp, whether it's udp
*
* @param read_buffer_size
* @param is_udp, whether it's udp
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_conn_init(ms_conn_t *c,
const int init_state,
*/
static int ms_conn_init(ms_conn_t *c,
const int init_state,
@@
-381,7
+381,7
@@
static int ms_conn_init(ms_conn_t *c,
atomic_add_32(&ms_stats.active_conns, 1);
}
atomic_add_32(&ms_stats.active_conns, 1);
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_conn_init */
} /* ms_conn_init */
@@
-414,7
+414,7
@@
static void ms_warmup_num_init(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_item_win_init(ms_conn_t *c)
{
*/
static int ms_item_win_init(ms_conn_t *c)
{
@@
-458,7
+458,7
@@
static int ms_item_win_init(ms_conn_t *c)
ms_warmup_num_init(c);
ms_warmup_num_init(c);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_item_win_init */
} /* ms_item_win_init */
@@
-469,7
+469,7
@@
static int ms_item_win_init(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_conn_sock_init(ms_conn_t *c)
{
*/
static int ms_conn_sock_init(ms_conn_t *c)
{
@@
-553,7
+553,7
@@
static int ms_conn_sock_init(ms_conn_t *c)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_conn_sock_init */
} /* ms_conn_sock_init */
@@
-563,7
+563,7
@@
static int ms_conn_sock_init(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_conn_event_init(ms_conn_t *c)
{
*/
static int ms_conn_event_init(ms_conn_t *c)
{
@@
-579,7
+579,7
@@
static int ms_conn_event_init(ms_conn_t *c)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_conn_event_init */
} /* ms_conn_event_init */
@@
-589,7
+589,7
@@
static int ms_conn_event_init(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_setup_conn(ms_conn_t *c)
{
*/
int ms_setup_conn(ms_conn_t *c)
{
@@
-613,7
+613,7
@@
int ms_setup_conn(ms_conn_t *c)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_setup_conn */
} /* ms_setup_conn */
@@
-707,7
+707,7
@@
static void ms_conn_close(ms_conn_t *c)
*
* @param ai, server address information
*
*
* @param ai, server address information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_new_socket(struct addrinfo *ai)
{
*/
static int ms_new_socket(struct addrinfo *ai)
{
@@
-771,7
+771,7
@@
static void ms_maximize_sndbuf(const int sfd)
* @param is_udp, whether it's udp
* @param ret_sfd, the connected socket file descriptor
*
* @param is_udp, whether it's udp
* @param ret_sfd, the connected socket file descriptor
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_network_connect(ms_conn_t *c,
char *srv_host_name,
*/
static int ms_network_connect(ms_conn_t *c,
char *srv_host_name,
@@
-894,7
+894,7
@@
static int ms_network_connect(ms_conn_t *c,
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_reconn(ms_conn_t *c)
{
*/
static int ms_reconn(ms_conn_t *c)
{
@@
-984,7
+984,7
@@
static int ms_reconn(ms_conn_t *c)
c->alive_sfds--;
}
c->alive_sfds--;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_reconn */
} /* ms_reconn */
@@
-996,7
+996,7
@@
static int ms_reconn(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_reconn_socks(ms_conn_t *c)
{
*/
int ms_reconn_socks(ms_conn_t *c)
{
@@
-1010,7
+1010,7
@@
int ms_reconn_socks(ms_conn_t *c)
if ((c->total_sfds == 1) || (c->total_sfds == c->alive_sfds))
{
if ((c->total_sfds == 1) || (c->total_sfds == c->alive_sfds))
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
for (uint32_t i= 0; i < c->total_sfds; i++)
}
for (uint32_t i= 0; i < c->total_sfds; i++)
@@
-1065,7
+1065,7
@@
int ms_reconn_socks(ms_conn_t *c)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_reconn_socks */
} /* ms_reconn_socks */
@@
-1137,7
+1137,7
@@
static int ms_tokenize_command(char *command,
* @param c, pointer of the concurrency
* @param command, the string responded by server
*
* @param c, pointer of the concurrency
* @param command, the string responded by server
*
- * @return int, if the command completed return
0
, else return
+ * @return int, if the command completed return
EXIT_SUCCESS
, else return
* -1
*/
static int ms_ascii_process_line(ms_conn_t *c, char *command)
* -1
*/
static int ms_ascii_process_line(ms_conn_t *c, char *command)
@@
-1312,7
+1312,7
@@
void ms_reset_conn(ms_conn_t *c, bool timeout)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_try_read_line(ms_conn_t *c)
{
*/
static int ms_try_read_line(ms_conn_t *c)
{
@@
-1322,7
+1322,7
@@
static int ms_try_read_line(ms_conn_t *c)
if ((uint64_t)c->rbytes < sizeof(c->binary_header))
{
/* need more data! */
if ((uint64_t)c->rbytes < sizeof(c->binary_header))
{
/* need more data! */
- return
0
;
+ return
EXIT_SUCCESS
;
}
else
{
}
else
{
@@
-1352,7
+1352,7
@@
static int ms_try_read_line(ms_conn_t *c)
fprintf(stderr, "Invalid magic: %x\n",
c->binary_header.response.magic);
ms_conn_set_state(c, conn_closing);
fprintf(stderr, "Invalid magic: %x\n",
c->binary_header.response.magic);
ms_conn_set_state(c, conn_closing);
- return
0
;
+ return
EXIT_SUCCESS
;
}
/* process this complete response */
}
/* process this complete response */
@@
-1377,11
+1377,11
@@
static int ms_try_read_line(ms_conn_t *c)
assert(c->rcurr <= (c->rbuf + c->rsize));
if (c->rbytes == 0)
assert(c->rcurr <= (c->rbuf + c->rsize));
if (c->rbytes == 0)
- return
0
;
+ return
EXIT_SUCCESS
;
el= memchr(c->rcurr, '\n', (size_t)c->rbytes);
if (! el)
el= memchr(c->rcurr, '\n', (size_t)c->rbytes);
if (! el)
- return
0
;
+ return
EXIT_SUCCESS
;
cont= el + 1;
if (((el - c->rcurr) > 1) && (*(el - 1) == '\r'))
cont= el + 1;
if (((el - c->rcurr) > 1) && (*(el - 1) == '\r'))
@@
-1635,7
+1635,7
@@
static int ms_udp_read(ms_conn_t *c, char *buf, int len)
* close.
* before reading, move the remaining incomplete fragment of a command
* (if any) to the beginning of the buffer.
* close.
* before reading, move the remaining incomplete fragment of a command
* (if any) to the beginning of the buffer.
- * return
0
if there's nothing to read on the first read.
+ * return
EXIT_SUCCESS
if there's nothing to read on the first read.
*/
/**
*/
/**
@@
-1646,8
+1646,8
@@
static int ms_udp_read(ms_conn_t *c, char *buf, int len)
* @param c, pointer of the concurrency
*
* @return int,
* @param c, pointer of the concurrency
*
* @return int,
- * return
0
if there's nothing to read on the first read.
- * return
1
if get data
+ * return
EXIT_SUCCESS
if there's nothing to read on the first read.
+ * return
EXIT_FAILURE
if get data
* return -1 if error happens
*/
static int ms_try_read_network(ms_conn_t *c)
* return -1 if error happens
*/
static int ms_try_read_network(ms_conn_t *c)
@@
-2013,7
+2013,7
@@
static void ms_complete_nread(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_add_msghdr(ms_conn_t *c)
{
*/
static int ms_add_msghdr(ms_conn_t *c)
{
@@
-2057,7
+2057,7
@@
static int ms_add_msghdr(ms_conn_t *c)
return ms_add_iov(c, NULL, UDP_HEADER_SIZE);
}
return ms_add_iov(c, NULL, UDP_HEADER_SIZE);
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_add_msghdr */
} /* ms_add_msghdr */
@@
-2067,7
+2067,7
@@
static int ms_add_msghdr(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_ensure_iov_space(ms_conn_t *c)
{
*/
static int ms_ensure_iov_space(ms_conn_t *c)
{
@@
-2094,7
+2094,7
@@
static int ms_ensure_iov_space(ms_conn_t *c)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_ensure_iov_space */
} /* ms_ensure_iov_space */
@@
-2106,7
+2106,7
@@
static int ms_ensure_iov_space(ms_conn_t *c)
* @param buf, the buffer includes data to send
* @param len, the data length in the buffer
*
* @param buf, the buffer includes data to send
* @param len, the data length in the buffer
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_add_iov(ms_conn_t *c, const void *buf, int len)
{
*/
static int ms_add_iov(ms_conn_t *c, const void *buf, int len)
{
@@
-2160,7
+2160,7
@@
static int ms_add_iov(ms_conn_t *c, const void *buf, int len)
}
while (leftover > 0);
}
while (leftover > 0);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_add_iov */
} /* ms_add_iov */
@@
-2169,7
+2169,7
@@
static int ms_add_iov(ms_conn_t *c, const void *buf, int len)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_udp_headers(ms_conn_t *c)
{
*/
static int ms_build_udp_headers(ms_conn_t *c)
{
@@
-2220,7
+2220,7
@@
static int ms_build_udp_headers(ms_conn_t *c)
+ UDP_HEADER_SIZE));
}
+ UDP_HEADER_SIZE));
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_udp_headers */
} /* ms_build_udp_headers */
@@
-2725,7
+2725,7
@@
void ms_event_handler(const int fd, const short which, void *arg)
* @param c, pointer of the concurrency
* @param cmd, command(get or set )
*
* @param c, pointer of the concurrency
* @param cmd, command(get or set )
*
- * @return int, if success, return the index, else return
0
+ * @return int, if success, return the index, else return
EXIT_SUCCESS
*/
static uint32_t ms_get_rep_sock_index(ms_conn_t *c, int cmd)
{
*/
static uint32_t ms_get_rep_sock_index(ms_conn_t *c, int cmd)
{
@@
-2734,7
+2734,7
@@
static uint32_t ms_get_rep_sock_index(ms_conn_t *c, int cmd)
if (c->total_sfds == 1)
{
if (c->total_sfds == 1)
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (ms_setting.rep_write_srv == 0)
}
if (ms_setting.rep_write_srv == 0)
@@
-2803,7
+2803,7
@@
static uint32_t ms_get_next_sock_index(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_update_conn_sock_event(ms_conn_t *c)
{
*/
static int ms_update_conn_sock_event(ms_conn_t *c)
{
@@
-2867,7
+2867,7
@@
static int ms_update_conn_sock_event(ms_conn_t *c)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_update_conn_sock_event */
} /* ms_update_conn_sock_event */
@@
-2879,7
+2879,7
@@
static int ms_update_conn_sock_event(ms_conn_t *c)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_ascii_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
{
*/
static int ms_build_ascii_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
{
@@
-2924,7
+2924,7
@@
static int ms_build_ascii_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_ascii_write_buf_set */
} /* ms_build_ascii_write_buf_set */
@@
-2935,7
+2935,7
@@
static int ms_build_ascii_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_mcd_set(ms_conn_t *c, ms_task_item_t *item)
{
*/
int ms_mcd_set(ms_conn_t *c, ms_task_item_t *item)
{
@@
-2979,7
+2979,7
@@
int ms_mcd_set(ms_conn_t *c, ms_task_item_t *item)
item->key_size + item->value_size);
atomic_add_size(&ms_stats.cmd_set, 1);
item->key_size + item->value_size);
atomic_add_size(&ms_stats.cmd_set, 1);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_mcd_set */
} /* ms_mcd_set */
@@
-2991,7
+2991,7
@@
int ms_mcd_set(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_ascii_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
{
*/
static int ms_build_ascii_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
{
@@
-3006,7
+3006,7
@@
static int ms_build_ascii_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_ascii_write_buf_get */
} /* ms_build_ascii_write_buf_get */
@@
-3017,7
+3017,7
@@
static int ms_build_ascii_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_mcd_get(ms_conn_t *c, ms_task_item_t *item)
{
*/
int ms_mcd_get(ms_conn_t *c, ms_task_item_t *item)
{
@@
-3059,7
+3059,7
@@
int ms_mcd_get(ms_conn_t *c, ms_task_item_t *item)
atomic_add_size(&ms_stats.cmd_get, 1);
atomic_add_size(&ms_stats.cmd_get, 1);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_mcd_get */
} /* ms_mcd_get */
@@
-3069,7
+3069,7
@@
int ms_mcd_get(ms_conn_t *c, ms_task_item_t *item)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_ascii_write_buf_mlget(ms_conn_t *c)
{
*/
static int ms_build_ascii_write_buf_mlget(ms_conn_t *c)
{
@@
-3100,7
+3100,7
@@
static int ms_build_ascii_write_buf_mlget(ms_conn_t *c)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_ascii_write_buf_mlget */
} /* ms_build_ascii_write_buf_mlget */
@@
-3109,7
+3109,7
@@
static int ms_build_ascii_write_buf_mlget(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_mcd_mlget(ms_conn_t *c)
{
*/
int ms_mcd_mlget(ms_conn_t *c)
{
@@
-3159,7
+3159,7
@@
int ms_mcd_mlget(ms_conn_t *c)
atomic_add_size(&ms_stats.cmd_get, 1);
}
atomic_add_size(&ms_stats.cmd_get, 1);
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_mcd_mlget */
} /* ms_mcd_mlget */
@@
-3172,7
+3172,7
@@
int ms_mcd_mlget(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_bin_process_response(ms_conn_t *c)
{
*/
static int ms_bin_process_response(ms_conn_t *c)
{
@@
-3188,7
+3188,7
@@
static int ms_bin_process_response(ms_conn_t *c)
{
c->rvbytes= (int32_t)bodylen;
c->readval= true;
{
c->rvbytes= (int32_t)bodylen;
c->readval= true;
- return
1
;
+ return
EXIT_FAILURE
;
}
else
{
}
else
{
@@
-3255,7
+3255,7
@@
static int ms_bin_process_response(ms_conn_t *c)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_bin_process_response */
} /* ms_bin_process_response */
@@
-3321,7
+3321,7
@@
static void ms_add_key_to_iov(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_bin_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
{
*/
static int ms_build_bin_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
{
@@
-3353,7
+3353,7
@@
static int ms_build_bin_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
}
ms_add_iov(c, &ms_setting.char_block[value_offset], item->value_size);
}
ms_add_iov(c, &ms_setting.char_block[value_offset], item->value_size);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_bin_write_buf_set */
} /* ms_build_bin_write_buf_set */
@@
-3365,7
+3365,7
@@
static int ms_build_bin_write_buf_set(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_bin_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
{
*/
static int ms_build_bin_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
{
@@
-3375,7
+3375,7
@@
static int ms_build_bin_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
(uint32_t)item->key_size);
ms_add_key_to_iov(c, item);
(uint32_t)item->key_size);
ms_add_key_to_iov(c, item);
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_bin_write_buf_get */
} /* ms_build_bin_write_buf_get */
@@
-3387,7
+3387,7
@@
static int ms_build_bin_write_buf_get(ms_conn_t *c, ms_task_item_t *item)
* @param item, pointer of task item which includes the object
* information
*
* @param item, pointer of task item which includes the object
* information
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_build_bin_write_buf_mlget(ms_conn_t *c)
{
*/
static int ms_build_bin_write_buf_mlget(ms_conn_t *c)
{
@@
-3411,5
+3411,5
@@
static int ms_build_bin_write_buf_mlget(ms_conn_t *c)
c->wcurr= c->wbuf;
c->wcurr= c->wbuf;
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_build_bin_write_buf_mlget */
} /* ms_build_bin_write_buf_mlget */
diff --git
a/clients/ms_setting.c
b/clients/ms_setting.c
index d7099709490d0edba7f55b7965082982ba129601..c3444c9aa78b203714d1473560b79a3d59247f0d 100644
(file)
--- a/
clients/ms_setting.c
+++ b/
clients/ms_setting.c
@@
-195,7
+195,7
@@
static void ms_get_serverlist(char *str)
/**
* used to get the CPU count of the current system
*
/**
* used to get the CPU count of the current system
*
- * @return return the cpu count if get, else return
1
+ * @return return the cpu count if get, else return
EXIT_FAILURE
*/
static uint32_t ms_get_cpu_count()
{
*/
static uint32_t ms_get_cpu_count()
{
@@
-223,7
+223,7
@@
static uint32_t ms_get_cpu_count()
#endif
/* the system with one cpu at least */
#endif
/* the system with one cpu at least */
- return
1
;
+ return
EXIT_FAILURE
;
} /* ms_get_cpu_count */
} /* ms_get_cpu_count */
@@
-262,7
+262,7
@@
ms_conf_type_t ms_get_conf_type(char *line)
*
* @param line, string of one line
*
*
* @param line, string of one line
*
- * @return if success, return
1, else return 0
+ * @return if success, return
EXIT_FAILURE, else return EXIT_SUCCESS
*/
static int ms_is_line_data(char *line)
{
*/
static int ms_is_line_data(char *line)
{
@@
-275,9
+275,9
@@
static int ms_is_line_data(char *line)
begin_ptr++;
}
if ((begin_ptr[0] == '\0') || (begin_ptr[0] == '#'))
begin_ptr++;
}
if ((begin_ptr[0] == '\0') || (begin_ptr[0] == '#'))
- return
0
;
+ return
EXIT_SUCCESS
;
- return
1
;
+ return
EXIT_FAILURE
;
} /* ms_is_line_data */
} /* ms_is_line_data */
@@
-287,14
+287,14
@@
static int ms_is_line_data(char *line)
* @param line, string of one line
* @param nread, length of the line
*
* @param line, string of one line
* @param nread, length of the line
*
- * @return if it's EOF or not line data, return
0, else return 1
+ * @return if it's EOF or not line data, return
EXIT_SUCCESS, else return EXIT_FAILURE
*/
static int ms_read_is_data(char *line, ssize_t nread)
{
if ((nread == EOF) || ! ms_is_line_data(line))
*/
static int ms_read_is_data(char *line, ssize_t nread)
{
if ((nread == EOF) || ! ms_is_line_data(line))
- return
0
;
+ return
EXIT_SUCCESS
;
- return
1
;
+ return
EXIT_FAILURE
;
} /* ms_read_is_data */
} /* ms_read_is_data */
@@
-575,7
+575,7
@@
static void ms_calc_avg_size()
* @param distr, pointer of distribution structure array
* @param length, length of the array
*
* @param distr, pointer of distribution structure array
* @param length, length of the array
*
- * @return always return
0
+ * @return always return
EXIT_SUCCESS
*/
static int ms_shuffle_distr(ms_distr_t *distr, int length)
{
*/
static int ms_shuffle_distr(ms_distr_t *distr, int length)
{
@@
-614,7
+614,7
@@
static int ms_shuffle_distr(ms_distr_t *distr, int length)
} /* switch */
}
} /* switch */
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_shuffle_distr */
} /* ms_shuffle_distr */
diff --git
a/clients/ms_sigsegv.c
b/clients/ms_sigsegv.c
index 60e1f59c581a26a74469cc102766eb9003892422..c9a366a0f01b674ec005d82e9fa209a5ee90c191 100644
(file)
--- a/
clients/ms_sigsegv.c
+++ b/
clients/ms_sigsegv.c
@@
-61,7
+61,7
@@
static void ms_signal_int(int signum, siginfo_t *info, void *ptr)
/**
* redirect signal seg
*
/**
* redirect signal seg
*
- * @return if success, return
0
, else return -1
+ * @return if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_setup_sigsegv(void)
{
*/
int ms_setup_sigsegv(void)
{
@@
-73,7
+73,7
@@
int ms_setup_sigsegv(void)
if (sigaction(SIGSEGV, &action, NULL) < 0)
{
perror("sigaction");
if (sigaction(SIGSEGV, &action, NULL) < 0)
{
perror("sigaction");
- return
0
;
+ return
EXIT_SUCCESS
;
}
return -1;
}
return -1;
@@
-83,7
+83,7
@@
int ms_setup_sigsegv(void)
/**
* redirect signal pipe
*
/**
* redirect signal pipe
*
- * @return if success, return
0
, else return -1
+ * @return if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_setup_sigpipe(void)
{
*/
int ms_setup_sigpipe(void)
{
@@
-97,7
+97,7
@@
int ms_setup_sigpipe(void)
/**
* redirect signal int
*
/**
* redirect signal int
*
- * @return if success, return
0
, else return -1
+ * @return if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_setup_sigint(void)
{
*/
int ms_setup_sigint(void)
{
@@
-109,7
+109,7
@@
int ms_setup_sigint(void)
if (sigaction(SIGINT, &action_3, NULL) < 0)
{
perror("sigaction");
if (sigaction(SIGINT, &action_3, NULL) < 0)
{
perror("sigaction");
- return
0
;
+ return
EXIT_SUCCESS
;
}
return -1;
}
return -1;
diff --git
a/clients/ms_task.c
b/clients/ms_task.c
index 631c35ea1a7bf4ab883a4a7efb320973ffa684f9..7e7921fcf2b9b6cc44e17c84bfd39e1b5461c20f 100644
(file)
--- a/
clients/ms_task.c
+++ b/
clients/ms_task.c
@@
-1053,7
+1053,7
@@
static void ms_update_task_result(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_run_getset_task(ms_conn_t *c)
{
*/
static int ms_run_getset_task(ms_conn_t *c)
{
@@
-1085,7
+1085,7
@@
static int ms_run_getset_task(ms_conn_t *c)
return -1;
}
return -1;
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_run_getset_task */
} /* ms_run_getset_task */
@@
-1094,7
+1094,7
@@
static int ms_run_getset_task(ms_conn_t *c)
*
* @param c, pointer of the concurrency
*
*
* @param c, pointer of the concurrency
*
- * @return int, if success, return
0
, else return -1
+ * @return int, if success, return
EXIT_SUCCESS
, else return -1
*/
int ms_exec_task(struct conn *c)
{
*/
int ms_exec_task(struct conn *c)
{
@@
-1110,5
+1110,5
@@
int ms_exec_task(struct conn *c)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_exec_task */
} /* ms_exec_task */
diff --git
a/clients/ms_thread.c
b/clients/ms_thread.c
index 299412a19488e01809d749aaf75872fc0e9a8ade..1efe5cfbb6f62df9dc8975033065d6ae933db002 100644
(file)
--- a/
clients/ms_thread.c
+++ b/
clients/ms_thread.c
@@
-146,7
+146,7
@@
static void ms_clock_handler(const int fd, const short which, void *arg)
*
* @param cpu, cpu index
*
*
* @param cpu, cpu index
*
- * @return if success, return
0
, else return -1
+ * @return if success, return
EXIT_SUCCESS
, else return -1
*/
static uint32_t ms_set_thread_cpu_affinity(uint32_t cpu)
{
*/
static uint32_t ms_set_thread_cpu_affinity(uint32_t cpu)
{
@@
-175,7
+175,7
@@
static uint32_t ms_set_thread_cpu_affinity(uint32_t cpu)
*
* @param thread_ctx, pointer of the thread context structure
*
*
* @param thread_ctx, pointer of the thread context structure
*
- * @return if success, return
0
, else return -1
+ * @return if success, return
EXIT_SUCCESS
, else return -1
*/
static int ms_setup_thread(ms_thread_ctx_t *thread_ctx)
{
*/
static int ms_setup_thread(ms_thread_ctx_t *thread_ctx)
{
@@
-231,7
+231,7
@@
static int ms_setup_thread(ms_thread_ctx_t *thread_ctx)
}
}
}
}
- return
0
;
+ return
EXIT_SUCCESS
;
} /* ms_setup_thread */
} /* ms_setup_thread */
diff --git
a/example/memcached_light.c
b/example/memcached_light.c
index 84635b2a29387e1526d7e2fc2146c46eedfae311..8465ff287d5ace3291ccc3e44b36db364ab6242d 100644
(file)
--- a/
example/memcached_light.c
+++ b/
example/memcached_light.c
@@
-180,7
+180,7
@@
static int server_socket(const char *port)
else
perror("getaddrinfo()");
else
perror("getaddrinfo()");
- return
1
;
+ return
EXIT_FAILURE
;
}
struct linger ling= {0, 0};
}
struct linger ling= {0, 0};
@@
-343,7
+343,7
@@
static protocol_binary_response_status unknown(const void *cookie,
*
* @param argc number of items in the argument vector
* @param argv argument vector
*
* @param argc number of items in the argument vector
* @param argv argument vector
- * @return
0
on success, 1 otherwise
+ * @return
EXIT_SUCCESS
on success, 1 otherwise
*/
int main(int argc, char **argv)
{
*/
int main(int argc, char **argv)
{
@@
-356,7
+356,7
@@
int main(int argc, char **argv)
if (event_base == NULL)
{
fprintf(stderr, "Failed to create an instance of libevent\n");
if (event_base == NULL)
{
fprintf(stderr, "Failed to create an instance of libevent\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
/*
}
/*
@@
-389,14
+389,14
@@
int main(int argc, char **argv)
default:
(void)fprintf(stderr, "Usage: %s [-p port] [-v] [-1] [-c #clients] [-P pidfile]\n",
argv[0]);
default:
(void)fprintf(stderr, "Usage: %s [-p port] [-v] [-1] [-c #clients] [-P pidfile]\n",
argv[0]);
- return
1
;
+ return
EXIT_FAILURE
;
}
}
if (! initialize_storage())
{
/* Error message already printed */
}
}
if (! initialize_storage())
{
/* Error message already printed */
- return
1
;
+ return
EXIT_FAILURE
;
}
if (! global_options.has_port)
}
if (! global_options.has_port)
@@
-423,7
+423,7
@@
int main(int argc, char **argv)
if (num_server_sockets == 0)
{
fprintf(stderr, "I don't have any server sockets\n");
if (num_server_sockets == 0)
{
fprintf(stderr, "I don't have any server sockets\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
/*
}
/*
@@
-439,14
+439,14
@@
int main(int argc, char **argv)
if ((protocol_handle= memcached_protocol_create_instance()) == NULL)
{
fprintf(stderr, "Failed to allocate protocol handle\n");
if ((protocol_handle= memcached_protocol_create_instance()) == NULL)
{
fprintf(stderr, "Failed to allocate protocol handle\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
socket_userdata_map= calloc((size_t)(maxconns), sizeof(struct connection));
if (socket_userdata_map == NULL)
{
fprintf(stderr, "Failed to allocate room for connections\n");
}
socket_userdata_map= calloc((size_t)(maxconns), sizeof(struct connection));
if (socket_userdata_map == NULL)
{
fprintf(stderr, "Failed to allocate room for connections\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
memcached_binary_protocol_set_callbacks(protocol_handle, interface);
}
memcached_binary_protocol_set_callbacks(protocol_handle, interface);
@@
-470,5
+470,5
@@
int main(int argc, char **argv)
event_base_loop(event_base, 0);
/* NOTREACHED */
event_base_loop(event_base, 0);
/* NOTREACHED */
- return
0
;
+ return
EXIT_SUCCESS
;
}
}
diff --git
a/libhashkit/digest.c
b/libhashkit/digest.c
index 4ff6de29f08f11e2d5d092afbe512b00dd5f5dba..f418dc0b644c40309e444cc58a8452b665583026 100644
(file)
--- a/
libhashkit/digest.c
+++ b/
libhashkit/digest.c
@@
-35,13
+35,13
@@
uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash_algo
#ifdef HAVE_HSIEH_HASH
return libhashkit_hsieh(key, key_length);
#else
#ifdef HAVE_HSIEH_HASH
return libhashkit_hsieh(key, key_length);
#else
- return
1
;
+ return
EXIT_FAILURE
;
#endif
case HASHKIT_HASH_MURMUR:
#ifdef HAVE_MURMUR_HASH
return libhashkit_murmur(key, key_length);
#else
#endif
case HASHKIT_HASH_MURMUR:
#ifdef HAVE_MURMUR_HASH
return libhashkit_murmur(key, key_length);
#else
- return
1
;
+ return
EXIT_FAILURE
;
#endif
case HASHKIT_HASH_JENKINS:
return libhashkit_jenkins(key, key_length);
#endif
case HASHKIT_HASH_JENKINS:
return libhashkit_jenkins(key, key_length);
@@
-56,5
+56,5
@@
uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash_algo
break;
}
break;
}
- return
1
;
+ return
EXIT_FAILURE
;
}
}
diff --git
a/libhashkit/hsieh.c
b/libhashkit/hsieh.c
index ba46ed2cdf71c3b59e1f43691703885722c7c4f5..cb5af8aec74524540fd97afb2b1bac0ffd797c07 100644
(file)
--- a/
libhashkit/hsieh.c
+++ b/
libhashkit/hsieh.c
@@
-23,7
+23,7
@@
uint32_t hashkit_hsieh(const char *key, size_t key_length, void *context __attri
int rem;
if (key_length <= 0 || key == NULL)
int rem;
if (key_length <= 0 || key == NULL)
- return
0
;
+ return
EXIT_SUCCESS
;
rem = key_length & 3;
key_length >>= 2;
rem = key_length & 3;
key_length >>= 2;
diff --git
a/libhashkit/ketama.c
b/libhashkit/ketama.c
index a510e57ab1ea802026d185cfcde3693c1fec7633..560de30031ccc329a5afcc4a3b238e3da4fb3a96 100644
(file)
--- a/
libhashkit/ketama.c
+++ b/
libhashkit/ketama.c
@@
-27,9
+27,9
@@
static int continuum_points_cmp(const void *t1, const void *t2)
hashkit_continuum_point_st *ct2= (hashkit_continuum_point_st *)t2;
if (ct1->value == ct2->value)
hashkit_continuum_point_st *ct2= (hashkit_continuum_point_st *)t2;
if (ct1->value == ct2->value)
- return
0
;
+ return
EXIT_SUCCESS
;
else if (ct1->value > ct2->value)
else if (ct1->value > ct2->value)
- return
1
;
+ return
EXIT_FAILURE
;
else
return -1;
}
else
return -1;
}
@@
-71,7
+71,7
@@
int update_continuum(hashkit_st *hashkit)
live_servers= (uint32_t)hashkit->list_size;
if (live_servers == 0)
live_servers= (uint32_t)hashkit->list_size;
if (live_servers == 0)
- return
0
;
+ return
EXIT_SUCCESS
;
if (hashkit->weight_fn == NULL)
{
if (hashkit->weight_fn == NULL)
{
@@
-159,6
+159,6
@@
int update_continuum(hashkit_st *hashkit)
qsort(hashkit->continuum, hashkit->continuum_points_count, sizeof(hashkit_continuum_point_st),
continuum_points_cmp);
qsort(hashkit->continuum, hashkit->continuum_points_count, sizeof(hashkit_continuum_point_st),
continuum_points_cmp);
- return
0
;
+ return
EXIT_SUCCESS
;
}
#endif
}
#endif
diff --git
a/libmemcached/behavior.c
b/libmemcached/behavior.c
index 2b6ccdf9112fda235bb2dc163497b9b49fd712f4..f88f0a771c1f556d926a20322cfb776da7f46789 100644
(file)
--- a/
libmemcached/behavior.c
+++ b/
libmemcached/behavior.c
@@
-314,18
+314,18
@@
uint64_t memcached_behavior_get(memcached_st *ptr,
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_SNDBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_SNDBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
- return
0
; /* Zero means error */
+ return
EXIT_SUCCESS
; /* Zero means error */
}
}
}
}
@@
-350,18
+350,18
@@
uint64_t memcached_behavior_get(memcached_st *ptr,
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_RCVBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_RCVBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
- return
0
; /* Zero means error */
+ return
EXIT_SUCCESS
; /* Zero means error */
}
}
}
}
@@
-385,7
+385,7
@@
uint64_t memcached_behavior_get(memcached_st *ptr,
case MEMCACHED_BEHAVIOR_MAX:
default:
WATCHPOINT_ASSERT(0); /* Programming mistake if it gets this far */
case MEMCACHED_BEHAVIOR_MAX:
default:
WATCHPOINT_ASSERT(0); /* Programming mistake if it gets this far */
- return
0
;
+ return
EXIT_SUCCESS
;
}
/* NOTREACHED */
}
/* NOTREACHED */
diff --git
a/libmemcached/hash.c
b/libmemcached/hash.c
index dda303952a5c86c2e6cc76de52c5a440474795eb..abad4f5bf3bce3951ee0f019560a733addca00fa 100644
(file)
--- a/
libmemcached/hash.c
+++ b/
libmemcached/hash.c
@@
-70,7
+70,7
@@
static inline uint32_t _generate_hash_wrapper(const memcached_st *ptr, const cha
WATCHPOINT_ASSERT(memcached_server_count(ptr));
if (memcached_server_count(ptr) == 1)
WATCHPOINT_ASSERT(memcached_server_count(ptr));
if (memcached_server_count(ptr) == 1)
- return
0
;
+ return
EXIT_SUCCESS
;
if (ptr->flags.hash_with_prefix_key)
{
if (ptr->flags.hash_with_prefix_key)
{
@@
-78,7
+78,7
@@
static inline uint32_t _generate_hash_wrapper(const memcached_st *ptr, const cha
char temp[temp_length];
if (temp_length > MEMCACHED_MAX_KEY -1)
char temp[temp_length];
if (temp_length > MEMCACHED_MAX_KEY -1)
- return
0
;
+ return
EXIT_SUCCESS
;
strncpy(temp, ptr->prefix_key, ptr->prefix_key_length);
strncpy(temp + ptr->prefix_key_length, key, key_length);
strncpy(temp, ptr->prefix_key, ptr->prefix_key_length);
strncpy(temp + ptr->prefix_key_length, key, key_length);
diff --git
a/libmemcached/hosts.c
b/libmemcached/hosts.c
index 9723f8b628ad8c49b42d3d1d6c4388ce63e8a22d..7034d3ec366dd5288ad9b8783b5ee2ca24a356a3 100644
(file)
--- a/
libmemcached/hosts.c
+++ b/
libmemcached/hosts.c
@@
-92,9
+92,9
@@
static int continuum_item_cmp(const void *t1, const void *t2)
/* Why 153? Hmmm... */
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
/* Why 153? Hmmm... */
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
- return
0
;
+ return
EXIT_SUCCESS
;
else if (ct1->value > ct2->value)
else if (ct1->value > ct2->value)
- return
1
;
+ return
EXIT_FAILURE
;
else
return -1;
}
else
return -1;
}
diff --git
a/libmemcached/io.c
b/libmemcached/io.c
index dedcdaf9e9deff939b1d599255263dae8baa4d30..2515dc1ea7c72b5f5e2a42404d3aa11f23233c4f 100644
(file)
--- a/
libmemcached/io.c
+++ b/
libmemcached/io.c
@@
-314,7
+314,7
@@
memcached_return_t memcached_io_read(memcached_server_write_instance_st ptr,
and protocol enforcement happens at memcached_response()
looking for '\n'. We do not care for UDB which requests 8 bytes
at once. Generally, this means that connection went away. Since
and protocol enforcement happens at memcached_response()
looking for '\n'. We do not care for UDB which requests 8 bytes
at once. Generally, this means that connection went away. Since
- for blocking I/O we do not return
0
and for non-blocking case
+ for blocking I/O we do not return
EXIT_SUCCESS
and for non-blocking case
it will return EGAIN if data is not immediatly available.
*/
WATCHPOINT_STRING("We had a zero length recv()");
it will return EGAIN if data is not immediatly available.
*/
WATCHPOINT_STRING("We had a zero length recv()");
@@
-600,7
+600,7
@@
static ssize_t io_flush(memcached_server_write_instance_st ptr,
if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP
&& ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH))
if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP
&& ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH))
- return
0
;
+ return
EXIT_SUCCESS
;
/* Looking for memory overflows */
#if defined(DEBUG)
/* Looking for memory overflows */
#if defined(DEBUG)
diff --git
a/libmemcached/protocol/ascii_handler.c
b/libmemcached/protocol/ascii_handler.c
index 465b73969766432963007dfabe7ea9e4e42b2c43..802b0859653351647b2ab2284ea21b1a1b3296c4 100644
(file)
--- a/
libmemcached/protocol/ascii_handler.c
+++ b/
libmemcached/protocol/ascii_handler.c
@@
-34,7
+34,7
@@
static uint16_t parse_ascii_key(char **start)
if (len == 0 || len > 240 || (*c != '\0' && *c != '\r' && iscntrl(*c)))
{
if (len == 0 || len > 240 || (*c != '\0' && *c != '\r' && iscntrl(*c)))
{
- return
0
;
+ return
EXIT_SUCCESS
;
}
return len;
}
return len;
@@
-558,7
+558,7
@@
static inline int process_storage_command(memcached_protocol_client_st *client,
{
/* Keep on reading */
recover_tokenize_command(start, *end);
{
/* Keep on reading */
recover_tokenize_command(start, *end);
- return
1
;
+ return
EXIT_FAILURE
;
}
void *data= (*end) + 1;
}
void *data= (*end) + 1;
@@
-658,7
+658,7
@@
static inline int process_storage_command(memcached_protocol_client_st *client,
*end += nbytes + 2;
*end += nbytes + 2;
- return
0
;
+ return
EXIT_SUCCESS
;
}
static int process_cas_command(memcached_protocol_client_st *client,
}
static int process_cas_command(memcached_protocol_client_st *client,
diff --git
a/libmemcached/util/pool.c
b/libmemcached/util/pool.c
index bd4fdf9868847bc0b8d0de0b6b7110778b6c3ce3..7879cc2312e6a4c8d321ca254998aa6e81fa9984 100644
(file)
--- a/
libmemcached/util/pool.c
+++ b/
libmemcached/util/pool.c
@@
-68,7
+68,7
@@
static int grow_pool(memcached_pool_st* pool)
pool->mmc[++pool->firstfree] = obj;
pool->current_size++;
pool->mmc[++pool->firstfree] = obj;
pool->current_size++;
- return
0
;
+ return
EXIT_SUCCESS
;
}
memcached_pool_st *memcached_pool_create(memcached_st* mmc,
}
memcached_pool_st *memcached_pool_create(memcached_st* mmc,
diff --git
a/libtest/test.c
b/libtest/test.c
index 009c4be5c7e9289c550b36b3c4cdb0a9bc726250..3d11d208464c05f72f885366fa66fd14d45622ce 100644
(file)
--- a/
libtest/test.c
+++ b/
libtest/test.c
@@
-156,7
+156,7
@@
int main(int argc, char *argv[])
if (sasl_client_init(NULL) != SASL_OK)
{
fprintf(stderr, "Failed to initialize sasl library!\n");
if (sasl_client_init(NULL) != SASL_OK)
{
fprintf(stderr, "Failed to initialize sasl library!\n");
- return
1
;
+ return
EXIT_FAILURE
;
}
#endif
}
#endif
@@
-357,7
+357,7
@@
cleanup:
if (error != TEST_SUCCESS)
{
fprintf(stderr, "Failure during shutdown.\n");
if (error != TEST_SUCCESS)
{
fprintf(stderr, "Failure during shutdown.\n");
- stats.failed++; // We do this to make our exit code return
1
+ stats.failed++; // We do this to make our exit code return
EXIT_FAILURE
}
}
}
}
diff --git
a/tests/atomsmasher.c
b/tests/atomsmasher.c
index 5b4bcbe241b7bb500deb1e8f2a9bcc1b2bf7fd75..afdf0830782bb3c4468a3073cbf157c991616d7e 100644
(file)
--- a/
tests/atomsmasher.c
+++ b/
tests/atomsmasher.c
@@
-48,7
+48,7
@@
static test_return_t cleanup_pairs(memcached_st *memc)
(void)memc;
pairs_free(global_pairs);
(void)memc;
pairs_free(global_pairs);
- return
0
;
+ return
EXIT_SUCCESS
;
}
static test_return_t generate_pairs(memcached_st *memc)
}
static test_return_t generate_pairs(memcached_st *memc)
@@
-63,7
+63,7
@@
static test_return_t generate_pairs(memcached_st *memc)
global_keys_length[x]= global_pairs[x].key_length;
}
global_keys_length[x]= global_pairs[x].key_length;
}
- return
0
;
+ return
EXIT_SUCCESS
;
}
static test_return_t drizzle(memcached_st *memc)
}
static test_return_t drizzle(memcached_st *memc)
@@
-160,7
+160,7
@@
static test_return_t add_test(memcached_st *memc)
test_true(rc == MEMCACHED_NOTSTORED);
}
test_true(rc == MEMCACHED_NOTSTORED);
}
- return
0
;
+ return
EXIT_SUCCESS
;
}
/*
}
/*
@@
-173,7
+173,7
@@
static test_return_t many_adds(memcached_st *memc)
{
add_test(memc);
}
{
add_test(memc);
}
- return
0
;
+ return
EXIT_SUCCESS
;
}
test_st smash_tests[] ={
}
test_st smash_tests[] ={
diff --git
a/tests/cpp_example.cc
b/tests/cpp_example.cc
index 0b2037240c00b32398cd52d0fb96b46aa21fe78c..fd0b00f47d74d6588bcdefaa6dd25b43b28da1ae 100644
(file)
--- a/
tests/cpp_example.cc
+++ b/
tests/cpp_example.cc
@@
-190,5
+190,5
@@
int main()
++it;
}
++it;
}
- return
0
;
+ return
EXIT_SUCCESS
;
}
}
diff --git
a/tests/start.c
b/tests/start.c
index ae9497f3a3a88a897c3670c106686e7118b6bf1a..1f5d43e285a42da124d947a9e2d815ec3566b823 100644
(file)
--- a/
tests/start.c
+++ b/
tests/start.c
@@
-25,5
+25,5
@@
int main(void)
server_startup(&construct);
server_startup(&construct);
- return
0
;
+ return
EXIT_SUCCESS
;
}
}