From 74216eb5f8016f5943a0f7ce84c47b550b30e676 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Tue, 27 Dec 2011 08:34:17 -0800 Subject: [PATCH] Fix -1 usage for bad socket descriptor --- libmemcached/connect.cc | 2 +- libmemcached/io.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } } -- 2.30.2