From: Brian Aker Date: Wed, 10 Feb 2010 01:18:52 +0000 (-0800) Subject: Fix for platform poll() return values. X-Git-Tag: 0.40~51 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6af823dc1939b0457aa0ccab10d41253e1631164;hp=d590ead1014a271bd96bebd5790f1bf8818e5cab;p=awesomized%2Flibmemcached Fix for platform poll() return values. --- 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