size_t loop_max = 5;
- if (server->root->poll_timeout == 0) {
+ if (server->root->connect_timeout == 0) {
return memcached_set_error(
*server, MEMCACHED_TIMEOUT, MEMCACHED_AT,
memcached_literal_param("The time to wait for a connection to be established was set to "
}
// If Zero, my hero, we just fail to a generic MEMCACHED_TIMEOUT error
- if (err != 0) {
+ if (err) {
return memcached_set_errno(
*server, err, MEMCACHED_AT,
memcached_literal_param("getsockopt() found the error from poll() after connect() "
char str_port[MEMCACHED_NI_MAXSERV] = {0};
errno = 0;
int length = snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port()));
- if (length >= MEMCACHED_NI_MAXSERV or length <= 0 or errno != 0) {
+ if (length >= MEMCACHED_NI_MAXSERV or length <= 0 or errno) {
return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
memcached_literal_param("snprintf(NI_MAXSERV)"));
}
#ifdef HAVE_FCNTL
// If SOCK_CLOEXEC exists then we don't need to call the following
if (SOCK_CLOEXEC == 0) {
- if (FD_CLOEXEC != 0) {
+ if (FD_CLOEXEC) {
int flags;
do {
flags = fcntl(server->fd, F_GETFD, 0);
do {
int type = SOCK_STREAM;
- if (SOCK_CLOEXEC != 0) {
+ if (SOCK_CLOEXEC) {
type |= SOCK_CLOEXEC;
}
- if (SOCK_NONBLOCK != 0) {
+ if (SOCK_NONBLOCK) {
type |= SOCK_NONBLOCK;
}
/* Create the socket */
while (server->address_info_next and server->fd == INVALID_SOCKET) {
int type = server->address_info_next->ai_socktype;
- if (SOCK_CLOEXEC != 0) {
+ if (SOCK_CLOEXEC) {
type |= SOCK_CLOEXEC;
}
- if (SOCK_NONBLOCK != 0) {
+ if (SOCK_NONBLOCK) {
type |= SOCK_NONBLOCK;
}