cmake: attempt to fix gh-actions not declaring HAVE_PTHREAD_H
[awesomized/libmemcached] / contrib / bin / memaslap / ms_conn.c
index 10737de543dad9a490838a7dbb2903ac93baa8e5..0c74fb91f02b1a8ad5c78cb0fc115a25e3e7490b 100644 (file)
@@ -1,6 +1,6 @@
 /*
     +--------------------------------------------------------------------+
-    | libmemcached - C/C++ Client Library for memcached                  |
+    | libmemcached-awesome - C/C++ Client Library for memcached          |
     +--------------------------------------------------------------------+
     | Redistribution and use in source and binary forms, with or without |
     | modification, are permitted under the terms of the BSD license.    |
@@ -1451,7 +1451,7 @@ static int ms_try_read_network(ms_conn_t *c) {
       return -1;
     }
     if (res == -1) {
-      if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
+      if ((errno == EAGAIN) || (EAGAIN != EWOULDBLOCK && errno == EWOULDBLOCK))
         break;
       /* Should close on unhandled errors. */
       ms_conn_set_state(c, conn_closing);
@@ -1909,7 +1909,7 @@ static int ms_transmit(ms_conn_t *c) {
       }
       return TRANSMIT_INCOMPLETE;
     }
-    if ((res == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
+    if ((res == -1) && ((errno == EAGAIN) || (EAGAIN != EWOULDBLOCK && errno == EWOULDBLOCK))) {
       if (!ms_update_event(c, EV_WRITE | EV_PERSIST)) {
         fprintf(stderr, "Couldn't update event.\n");
         ms_conn_set_state(c, conn_closing);