X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=contrib%2Fbin%2Fmemaslap%2Fms_conn.c;h=0c74fb91f02b1a8ad5c78cb0fc115a25e3e7490b;hb=refs%2Fpull%2F126%2Fhead;hp=f4375ae87bea7c318859d550fcd8b19b0991615b;hpb=fd0f1940d4b11f582fc237ff5ccf2c385eaa0e7d;p=awesomized%2Flibmemcached diff --git a/contrib/bin/memaslap/ms_conn.c b/contrib/bin/memaslap/ms_conn.c index f4375ae8..0c74fb91 100644 --- a/contrib/bin/memaslap/ms_conn.c +++ b/contrib/bin/memaslap/ms_conn.c @@ -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. | @@ -31,10 +31,7 @@ #if defined(HAVE_SYS_TIME_H) # include #endif - -#if defined(HAVE_TIME_H) -# include -#endif +#include #include "ms_setting.h" #include "ms_thread.h" @@ -1454,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); @@ -1912,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);