]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
global/signal_handler: poll on the control pipe, too
authorSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 20:56:10 +0000 (13:56 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 20:56:17 +0000 (13:56 -0700)
We also need to poll the control fd/pipe so that we restart the poll loop
when new signal handlers are added.  This was broken by commit 8e4a78f1.

Fixes: #5742
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/global/signal_handler.cc

index d403637002b15f78406397fcd1a457d8298e0dbe..ce604fe1e5d42270e134f0a55c32b6d7f8d8a157 100644 (file)
@@ -195,6 +195,10 @@ struct SignalHandler : public Thread {
 
       lock.Lock();
       int num_fds = 0;
+      fds[num_fds].fd = pipefd[0];
+      fds[num_fds].events = POLLIN | POLLOUT | POLLERR;
+      fds[num_fds].revents = 0;
+      ++num_fds;
       for (unsigned i=0; i<32; i++) {
        if (handlers[i]) {
          fds[num_fds].fd = handlers[i]->pipefd[0];