cmake: compat
[m6w6/libmemcached] / clients / ms_conn.c
index 2afc9fa10f029dc4a3b477317516a5f9ee408fff..71353d5b4806defd0b7f93bc6f611fbd775f130a 100644 (file)
 #include <fcntl.h>
 #include <netinet/tcp.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
+
+#if defined(HAVE_ARPA_INET_H)
+# include <arpa/inet.h>
+#endif
 
 #if defined(HAVE_SYS_TIME_H)
 # include <sys/time.h>
@@ -63,7 +66,7 @@
 static uint64_t key_prefix_seq= KEY_PREFIX_BASE;
 
 /* global increasing counter, generating request id for UDP */
-static volatile uint32_t udp_request_id= 0;
+static ATOMIC uint32_t udp_request_id= 0;
 
 extern pthread_key_t ms_thread_key;
 
@@ -1184,6 +1187,7 @@ static int ms_ascii_process_line(ms_conn_t *c, char *command)
 
   case 'O':   /* OK */
     c->currcmd.retstat= MCD_SUCCESS;
+    break;
 
   case 'S':                    /* STORED STATS SERVER_ERROR */
     if (buffer[2] == 'A')      /* STORED STATS */
@@ -2344,7 +2348,7 @@ static void ms_conn_shrink(ms_conn_t *c)
       && (c->rudpbytes + UDP_MAX_PAYLOAD_SIZE < UDP_DATA_BUFFER_SIZE))
   {
     char *new_rbuf= (char *)realloc(c->rudpbuf, (size_t)c->rudpsize * 2);
-    if (new_rbuf)
+    if (new_rbuf)
     {
       c->rudpbuf= new_rbuf;
       c->rudpsize= UDP_DATA_BUFFER_SIZE;