replacements then what I should have.
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
- return EXIT_SUCCESS;
+ return 0;
}
}
else
fprintf(stderr, "Failed to execute mget: %s\n",
memcached_strerror(memc, rc));
memcached_quit(memc);
- return EXIT_SUCCESS;
+ return 0;
}
return retrieved;
else
perror("getaddrinfo()");
- return EXIT_FAILURE;
+ return 0;
}
struct linger ling= {0, 0};
#ifdef HAVE_HSIEH_HASH
return libhashkit_hsieh(key, key_length);
#else
- return EXIT_FAILURE;
+ return 1;
#endif
case HASHKIT_HASH_MURMUR:
#ifdef HAVE_MURMUR_HASH
return libhashkit_murmur(key, key_length);
#else
- return EXIT_FAILURE;
+ return 1;
#endif
case HASHKIT_HASH_JENKINS:
return libhashkit_jenkins(key, key_length);
break;
}
- return EXIT_FAILURE;
+ return 1;
}
int rem;
if (key_length <= 0 || key == NULL)
- return EXIT_SUCCESS;
+ return 0;
rem = key_length & 3;
key_length >>= 2;
hashkit_continuum_point_st *ct2= (hashkit_continuum_point_st *)t2;
if (ct1->value == ct2->value)
- return EXIT_SUCCESS;
+ return 0;
else if (ct1->value > ct2->value)
- return EXIT_FAILURE;
+ return 1;
else
return -1;
}
live_servers= (uint32_t)hashkit->list_size;
if (live_servers == 0)
- return EXIT_SUCCESS;
+ return 0;
if (hashkit->weight_fn == NULL)
{
qsort(hashkit->continuum, hashkit->continuum_points_count, sizeof(hashkit_continuum_point_st),
continuum_points_cmp);
- return EXIT_SUCCESS;
+ return 0;
}
#endif
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
- return EXIT_SUCCESS;
+ return 0;
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
- return EXIT_SUCCESS;
+ return 0;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_SNDBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
- return EXIT_SUCCESS; /* Zero means error */
+ return 0; /* Zero means error */
}
}
/* We just try the first host, and if it is down we return zero */
if ((memcached_connect(instance)) != MEMCACHED_SUCCESS)
{
- return EXIT_SUCCESS;
+ return 0;
}
if (memcached_io_wait_for_write(instance) != MEMCACHED_SUCCESS)
{
- return EXIT_SUCCESS;
+ return 0;
}
if (getsockopt(instance->fd, SOL_SOCKET, SO_RCVBUF, &sock_size, &sock_length) < 0)
{
ptr->cached_errno= errno;
- return EXIT_SUCCESS; /* Zero means error */
+ return 0; /* Zero means error */
}
}
case MEMCACHED_BEHAVIOR_MAX:
default:
WATCHPOINT_ASSERT(0); /* Programming mistake if it gets this far */
- return EXIT_SUCCESS;
+ return 0;
}
/* NOTREACHED */
WATCHPOINT_ASSERT(memcached_server_count(ptr));
if (memcached_server_count(ptr) == 1)
- return EXIT_SUCCESS;
+ return 0;
if (ptr->flags.hash_with_prefix_key)
{
char temp[temp_length];
if (temp_length > MEMCACHED_MAX_KEY -1)
- return EXIT_SUCCESS;
+ return 0;
strncpy(temp, ptr->prefix_key, ptr->prefix_key_length);
strncpy(temp + ptr->prefix_key_length, key, key_length);
/* Why 153? Hmmm... */
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
- return EXIT_SUCCESS;
+ return 0;
else if (ct1->value > ct2->value)
- return EXIT_FAILURE;
+ return 1;
else
return -1;
}
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 EXIT_SUCCESS and for non-blocking case
+ for blocking I/O we do not return 0 and for non-blocking case
it will return EGAIN if data is not immediatly available.
*/
WATCHPOINT_STRING("We had a zero length recv()");
if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP
&& ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH))
- return EXIT_SUCCESS;
+ return 0;
/* Looking for memory overflows */
#if defined(DEBUG)
if (len == 0 || len > 240 || (*c != '\0' && *c != '\r' && iscntrl(*c)))
{
- return EXIT_SUCCESS;
+ return 0;
}
return len;
{
/* Keep on reading */
recover_tokenize_command(start, *end);
- return EXIT_FAILURE;
+ return 1;
}
void *data= (*end) + 1;
*end += nbytes + 2;
- return EXIT_SUCCESS;
+ return 0;
}
static int process_cas_command(memcached_protocol_client_st *client,