From 6af823dc1939b0457aa0ccab10d41253e1631164 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Tue, 9 Feb 2010 17:18:52 -0800 Subject: [PATCH] Fix for platform poll() return values. --- libmemcached/io.c | 7 ++++++- support/include.am | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libmemcached/io.c b/libmemcached/io.c index 17398aa3..6f5f3d23 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -53,7 +53,8 @@ static memcached_return_t io_wait(memcached_server_instance_st *ptr, if (ptr->root->flags.no_block == false) timeout= -1; - while (1) + size_t loop_max= 5; + while (--loop_max) { error= poll(&fds, 1, timeout); @@ -63,7 +64,9 @@ static memcached_return_t io_wait(memcached_server_instance_st *ptr, return MEMCACHED_SUCCESS; case 0: return MEMCACHED_TIMEOUT; +#if TARGET_OS_LINUX case ERESTART: +#endif case EINTR: continue; default: @@ -257,7 +260,9 @@ memcached_return_t memcached_io_read(memcached_server_instance_st *ptr, { case EAGAIN: case EINTR: +#if TARGET_OS_LINUX case ERESTART: +#endif if ((rc= io_wait(ptr, MEM_READ)) == MEMCACHED_SUCCESS) continue; /* fall through */ diff --git a/support/include.am b/support/include.am index 2f55d24a..c2df4a99 100644 --- a/support/include.am +++ b/support/include.am @@ -2,10 +2,10 @@ # included from Top Level Makefile.am # All paths should be given relative to the root -EXTRA_DIST += \ - support/libmemcached.spec \ - support/libmemcached-fc.spec.in \ - support/set_benchmark.sh +EXTRA_DIST+= \ + support/libmemcached.spec \ + support/libmemcached-fc.spec.in \ + support/set_benchmark.sh pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = support/libmemcached.pc -- 2.30.2