Remove use of system(). Not very portable
[awesomized/libmemcached] / libmemcached / protocol / binary_handler.c
index 2bafdeb1a445df0378bb4e366a955f1fca2bee3c..81c09c99f88f01154857cf4e35e7323f105c873c 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <stdlib.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <string.h>
@@ -59,11 +58,11 @@ raw_response_handler(const void *cookie,
                                      num_bytes);
       if (nw == -1)
       {
-        if (errno == EWOULDBLOCK)
+        if (get_socket_errno() == EWOULDBLOCK)
         {
           break;
         }
-        else if (errno != EINTR)
+        else if (get_socket_errno() != EINTR)
         {
           client->error= errno;
           return PROTOCOL_BINARY_RESPONSE_EIO;