Skip to content

Commit

Permalink
global/signal_handler: fix typo
Browse files Browse the repository at this point in the history
and use list initializer to init an array

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 8b14914)
  • Loading branch information
tchaikov authored and andyli029 committed Sep 21, 2017
1 parent 189f0c6 commit 12efd66
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/global/signal_handler.cc
Expand Up @@ -179,25 +179,22 @@ struct SignalHandler : public Thread {
};

/// all handlers
safe_handler *handlers[32];
safe_handler *handlers[32] = {nullptr};

/// to protect the handlers array
Mutex lock;

SignalHandler()
: stop(false), lock("SignalHandler::lock")
{
for (unsigned i = 0; i < 32; i++)
handlers[i] = NULL;

// create signal pipe
int r = pipe(pipefd);
assert(r == 0);
r = fcntl(pipefd[0], F_SETFL, O_NONBLOCK);
assert(r == 0);

// create thread
create("sginal_handler");
create("signal_handler");
}

~SignalHandler() {
Expand Down

0 comments on commit 12efd66

Please sign in to comment.