[Groonga-commit] groonga/groonga at f70e58d [master] Fix a bug that SIGSTOP and SIGCONT stops server

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 22 17:31:16 JST 2013


Kouhei Sutou	2013-05-22 17:31:16 +0900 (Wed, 22 May 2013)

  New Revision: f70e58d4e81a656af578eec7a2d600e7185d1730
  https://github.com/groonga/groonga/commit/f70e58d4e81a656af578eec7a2d600e7185d1730

  Message:
    Fix a bug that SIGSTOP and SIGCONT stops server

  Modified files:
    lib/com.c

  Modified: lib/com.c (+10 -3)
===================================================================
--- lib/com.c    2013-05-22 16:57:45 +0900 (910577d)
+++ lib/com.c    2013-05-22 17:31:16 +0900 (a1accd2)
@@ -576,6 +576,9 @@ grn_com_event_poll(grn_ctx *ctx, grn_com_event *ev, int timeout)
   ctx->errlvl = GRN_OK;
   ctx->rc = GRN_SUCCESS;
   nevents = epoll_wait(ev->epfd, ev->events, ev->max_nevents, timeout);
+  if (nevents < 0) {
+    SERR("epoll_wait");
+  }
 #else /* USE_EPOLL */
 #ifdef USE_KQUEUE
   struct kevent *ep;
@@ -585,6 +588,9 @@ grn_com_event_poll(grn_ctx *ctx, grn_com_event *ev, int timeout)
     tv.tv_nsec = (timeout % 1000) * 1000;
   }
   nevents = kevent(ev->kqfd, NULL, 0, ev->events, ev->max_nevents, &tv);
+  if (nevents < 0) {
+    SERR("kevent");
+  }
 #else /* USE_KQUEUE */
   uint32_t dummy;
   int nfd = 0, *pfd;
@@ -600,13 +606,14 @@ grn_com_event_poll(grn_ctx *ctx, grn_com_event *ev, int timeout)
     nfd++;
   });
   nevents = poll(ev->events, nfd, timeout);
+  if (nevents < 0) {
+    SERR("poll");
+  }
 #endif /* USE_KQUEUE */
 #endif /* USE_EPOLL */
-  if (nevents < 0) {
+  if (ctx->rc != GRN_SUCCESS) {
     if (ctx->rc == GRN_INTERRUPTED_FUNCTION_CALL) {
       ERRCLR(ctx);
-    } else {
-      SERR("poll");
     }
     return ctx->rc;
   }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index