From: Brian Aker Date: Tue, 27 Dec 2011 16:34:17 +0000 (-0800) Subject: Fix -1 usage for bad socket descriptor X-Git-Tag: 1.0.3~3^2~1^2~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=74216eb5f8016f5943a0f7ce84c47b550b30e676;p=awesomized%2Flibmemcached Fix -1 usage for bad socket descriptor --- diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index e04098c4..b81b25b9 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -231,7 +231,7 @@ static inline void set_socket_nonblocking(memcached_server_st *server) static void set_socket_options(memcached_server_st *server) { - assert_msg(server->fd != -1, "invalid socket was passed to set_socket_options()"); + assert_msg(server->fd != INVALID_SOCKET, "invalid socket was passed to set_socket_options()"); if (memcached_is_udp(server->root)) { diff --git a/libmemcached/io.cc b/libmemcached/io.cc index 8c8c3bc7..c0671e05 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -408,7 +408,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, default: memcached_quit_server(ptr, true); *error= memcached_set_errno(*ptr, get_socket_errno(), MEMCACHED_AT); - WATCHPOINT_ASSERT(ptr->fd == -1); + WATCHPOINT_ASSERT(ptr->fd == INVALID_SOCKET); return -1; } }