X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fio.c;h=070af6b19462d9056f7a3181ba4944e26ae7b9cf;hb=96c84d98b1b2db8419072eea960e8800c189586b;hp=616ad497b9798147229106c4c459788ccb11f913;hpb=54915965dc90f7aeceda9e9b1370c77eb8b1631f;p=awesomized%2Flibmemcached diff --git a/libmemcached/io.c b/libmemcached/io.c index 616ad497..070af6b1 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -64,20 +64,25 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr, case 1: return MEMCACHED_SUCCESS; case 0: - return MEMCACHED_TIMEOUT; -#ifdef TARGET_OS_LINUX - case ERESTART: -#endif - case EINTR: continue; default: - ptr->cached_errno= error; - memcached_quit_server(ptr, true); + WATCHPOINT_ERRNO(errno); + { + switch (errno) + { + default: + ptr->cached_errno= error; + memcached_quit_server(ptr, true); - return MEMCACHED_FAILURE; + return MEMCACHED_FAILURE; + } + } } } + if (loop_max == 0 && error == 0) + return MEMCACHED_TIMEOUT; + /* Imposssible for anything other then -1 */ WATCHPOINT_ASSERT(error == -1); ptr->cached_errno= error; @@ -583,6 +588,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, if (sent_length == -1) { ptr->cached_errno= errno; + WATCHPOINT_ERRNO(errno); switch (errno) { case ENOBUFS: