Fix for platform poll() return values.
authorBrian Aker <brian@gaz>
Wed, 10 Feb 2010 01:18:52 +0000 (17:18 -0800)
committerBrian Aker <brian@gaz>
Wed, 10 Feb 2010 01:18:52 +0000 (17:18 -0800)
libmemcached/io.c
support/include.am

index 17398aa37dd2bc54f790f6eec81b403b09456c69..6f5f3d2317fac14ae083add81c614d2033feb832 100644 (file)
@@ -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 */
index 2f55d24a6c2909b3cae126f0e91f72c8828d198a..c2df4a99915461423eac72f25832aa02313e5e4f 100644 (file)
@@ -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