and use list initializer to init an array
Signed-off-by: Kefu Chai <kchai@redhat.com>
};
/// 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);
assert(r == 0);
// create thread
- create("sginal_handler");
+ create("signal_handler");
}
~SignalHandler() {