#include <libmemcached/common.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
void initialize_binary_request(org::libmemcached::Instance* server, protocol_binary_request_header& header)
{
server->request_id++;
int local_errno= EINVAL;
int err;
socklen_t len= sizeof (err);
- if (getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, &err, &len) == 0)
+ if (getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, (char*)&err, &len) == 0)
{
if (err == 0) // treat this as EINTR
{
}
/* in case of death shutdown to avoid blocking at close() */
- if (shutdown(ptr->fd, SHUT_RDWR) == SOCKET_ERROR && get_socket_errno() != ENOTCONN)
+ if (shutdown(ptr->fd, SHUT_RDWR) == SOCKET_ERROR and get_socket_errno() != ENOTCONN)
{
WATCHPOINT_NUMBER(ptr->fd);
WATCHPOINT_ERRNO(get_socket_errno());