summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/global/global_init.cc4
-rw-r--r--src/global/pidfile.cc2
-rw-r--r--src/global/signal_handler.cc40
3 files changed, 23 insertions, 23 deletions
diff --git a/src/global/global_init.cc b/src/global/global_init.cc
index 37f5d8f9770..fc7e17704cc 100644
--- a/src/global/global_init.cc
+++ b/src/global/global_init.cc
@@ -172,11 +172,11 @@ global_init(const std::map<std::string,std::string> *defaults,
static bool first_run = true;
if (run_pre_init) {
// We will run pre_init from here (default).
- assert(!g_ceph_context && first_run);
+ ceph_assert(!g_ceph_context && first_run);
global_pre_init(defaults, args, module_type, code_env, flags);
} else {
// Caller should have invoked pre_init manually.
- assert(g_ceph_context && first_run);
+ ceph_assert(g_ceph_context && first_run);
}
first_run = false;
diff --git a/src/global/pidfile.cc b/src/global/pidfile.cc
index 2de2f54b95a..79e2a983715 100644
--- a/src/global/pidfile.cc
+++ b/src/global/pidfile.cc
@@ -222,7 +222,7 @@ int pidfile_write(const ConfigProxy& conf)
return 0;
}
- assert(pfh == nullptr);
+ ceph_assert(pfh == nullptr);
pfh = new pidfh();
if (atexit(pidfile_remove)) {
diff --git a/src/global/signal_handler.cc b/src/global/signal_handler.cc
index 4102d695657..8bb3e89aaf1 100644
--- a/src/global/signal_handler.cc
+++ b/src/global/signal_handler.cc
@@ -407,9 +407,9 @@ struct SignalHandler : public Thread {
{
// create signal pipe
int r = pipe(pipefd);
- assert(r == 0);
+ ceph_assert(r == 0);
r = fcntl(pipefd[0], F_SETFL, O_NONBLOCK);
- assert(r == 0);
+ ceph_assert(r == 0);
// create thread
create("signal_handler");
@@ -421,7 +421,7 @@ struct SignalHandler : public Thread {
void signal_thread() {
int r = write(pipefd[1], "\0", 1);
- assert(r == 1);
+ ceph_assert(r == 1);
}
void shutdown() {
@@ -509,9 +509,9 @@ struct SignalHandler : public Thread {
// defined. We can do this without the lock because we will never
// have the signal handler defined without the handlers entry also
// being filled in.
- assert(handlers[signum]);
+ ceph_assert(handlers[signum]);
int r = write(handlers[signum]->pipefd[1], " ", 1);
- assert(r == 1);
+ ceph_assert(r == 1);
}
void queue_signal_info(int signum, siginfo_t *siginfo, void * content) {
@@ -519,10 +519,10 @@ struct SignalHandler : public Thread {
// defined. We can do this without the lock because we will never
// have the signal handler defined without the handlers entry also
// being filled in.
- assert(handlers[signum]);
+ ceph_assert(handlers[signum]);
memcpy(&handlers[signum]->info_t, siginfo, sizeof(siginfo_t));
int r = write(handlers[signum]->pipefd[1], " ", 1);
- assert(r == 1);
+ ceph_assert(r == 1);
}
void register_handler(int signum, signal_handler_t handler, bool oneshot);
@@ -539,14 +539,14 @@ void SignalHandler::register_handler(int signum, signal_handler_t handler, bool
{
int r;
- assert(signum >= 0 && signum < 32);
+ ceph_assert(signum >= 0 && signum < 32);
safe_handler *h = new safe_handler;
r = pipe(h->pipefd);
- assert(r == 0);
+ ceph_assert(r == 0);
r = fcntl(h->pipefd[0], F_SETFL, O_NONBLOCK);
- assert(r == 0);
+ ceph_assert(r == 0);
h->handler = handler;
lock.Lock();
@@ -565,15 +565,15 @@ void SignalHandler::register_handler(int signum, signal_handler_t handler, bool
sigfillset(&act.sa_mask); // mask all signals in the handler
act.sa_flags = SA_SIGINFO | (oneshot ? SA_RESETHAND : 0);
int ret = sigaction(signum, &act, &oldact);
- assert(ret == 0);
+ ceph_assert(ret == 0);
}
void SignalHandler::unregister_handler(int signum, signal_handler_t handler)
{
- assert(signum >= 0 && signum < 32);
+ ceph_assert(signum >= 0 && signum < 32);
safe_handler *h = handlers[signum];
- assert(h);
- assert(h->handler == handler);
+ ceph_assert(h);
+ ceph_assert(h->handler == handler);
// restore to default
signal(signum, SIG_DFL);
@@ -594,38 +594,38 @@ void SignalHandler::unregister_handler(int signum, signal_handler_t handler)
void init_async_signal_handler()
{
- assert(!g_signal_handler);
+ ceph_assert(!g_signal_handler);
g_signal_handler = new SignalHandler;
}
void shutdown_async_signal_handler()
{
- assert(g_signal_handler);
+ ceph_assert(g_signal_handler);
delete g_signal_handler;
g_signal_handler = NULL;
}
void queue_async_signal(int signum)
{
- assert(g_signal_handler);
+ ceph_assert(g_signal_handler);
g_signal_handler->queue_signal(signum);
}
void register_async_signal_handler(int signum, signal_handler_t handler)
{
- assert(g_signal_handler);
+ ceph_assert(g_signal_handler);
g_signal_handler->register_handler(signum, handler, false);
}
void register_async_signal_handler_oneshot(int signum, signal_handler_t handler)
{
- assert(g_signal_handler);
+ ceph_assert(g_signal_handler);
g_signal_handler->register_handler(signum, handler, true);
}
void unregister_async_signal_handler(int signum, signal_handler_t handler)
{
- assert(g_signal_handler);
+ ceph_assert(g_signal_handler);
g_signal_handler->unregister_handler(signum, handler);
}