]> granicus.if.org Git - icinga2/commitdiff
Fix style
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Tue, 16 Jul 2019 09:43:47 +0000 (11:43 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Tue, 16 Jul 2019 09:45:23 +0000 (11:45 +0200)
refs #5230

lib/base/application.cpp
lib/cli/daemoncommand.cpp

index 7011ddc078a9ab8c4020d7dcc77f8bcdcd0b54ca..4707f0d230b88c5dd1e0cfa353ac83f769bb13d8 100644 (file)
@@ -305,7 +305,8 @@ void Application::RunEventLoop()
                                m_ReloadProcess = StartReloadProcess();
                        }
 #else /* _WIN32 */
-                       Log(LogNotice, "Application") << "Got reload command, forwarding to umbrella process (PID " << m_UmbrellaProcess << ")";
+                       Log(LogNotice, "Application")
+                               << "Got reload command, forwarding to umbrella process (PID " << m_UmbrellaProcess << ")";
 
                        (void)kill(m_UmbrellaProcess, SIGHUP);
 #endif /* _WIN32 */
index cdc105dc60eb048ae0972d31ae91645b3703c1fd..8091c403ef42138a158f25d5d7d1bcd9004bee7c 100644 (file)
@@ -208,17 +208,20 @@ int RunWorker(const std::vector<std::string>& configs)
                        return EXIT_FAILURE;
 
 #ifndef _WIN32
-               Log(LogNotice, "cli") << "Notifying umbrella process (PID " << l_UmbrellaPid << ") about the config loading success";
+               Log(LogNotice, "cli")
+                       << "Notifying umbrella process (PID " << l_UmbrellaPid << ") about the config loading success";
 
                (void)kill(l_UmbrellaPid, SIGUSR2);
 
-               Log(LogNotice, "cli") << "Waiting for the umbrella process to let us doing the actual work";
+               Log(LogNotice, "cli")
+                       << "Waiting for the umbrella process to let us doing the actual work";
 
                while (!l_AllowedToWork.load()) {
                        Utility::Sleep(0.2);
                }
 
-               Log(LogNotice, "cli") << "The umbrella process let us continuing";
+               Log(LogNotice, "cli")
+                       << "The umbrella process let us continuing";
 #endif /* _WIN32 */
 
                /* restore the previous program state */
@@ -399,7 +402,8 @@ static void NotifyWatchdog()
  */
 static pid_t StartUnixWorker(const std::vector<std::string>& configs)
 {
-       Log(LogNotice, "cli") << "Spawning seemless worker process doing the actual work";
+       Log(LogNotice, "cli")
+               << "Spawning seemless worker process doing the actual work";
 
        try {
                Application::UninitializeBase();
@@ -466,7 +470,8 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs)
                        l_CurrentlyStartingUnixWorkerPid.store(pid);
                        (void)sigprocmask(SIG_UNBLOCK, &l_UnixWorkerSignals, nullptr);
 
-                       Log(LogNotice, "cli") << "Spawned worker process (PID " << pid << "), waiting for it to load its config";
+                       Log(LogNotice, "cli")
+                               << "Spawned worker process (PID " << pid << "), waiting for it to load its config";
 
                        // Wait for the newly spawned process to either load its config or fail.
                        for (;;) {
@@ -476,10 +481,12 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs)
 
                                switch (l_CurrentlyStartingUnixWorkerState.load()) {
                                        case UnixWorkerState::LoadedConfig:
-                                               Log(LogNotice, "cli") << "Worker process successfully loaded its config";
+                                               Log(LogNotice, "cli")
+                                                       << "Worker process successfully loaded its config";
                                                break;
                                        case UnixWorkerState::Failed:
-                                               Log(LogNotice, "cli") << "Worker process couldn't load its config";
+                                               Log(LogNotice, "cli")
+                                                       << "Worker process couldn't load its config";
 
                                                while (waitpid(pid, nullptr, 0) == -1 && errno == EINTR) {
 #ifdef HAVE_SYSTEMD
@@ -659,7 +666,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
                if (!requestedTermination) {
                        int termSig = l_TermSignal.load();
                        if (termSig != -1) {
-                               Log(LogNotice, "cli") << "Got signal " << termSig << ", forwarding to seemless worker (PID " << currentWorker << ")";
+                               Log(LogNotice, "cli")
+                                       << "Got signal " << termSig << ", forwarding to seemless worker (PID " << currentWorker << ")";
 
                                (void)kill(currentWorker, termSig);
                                requestedTermination = true;
@@ -674,7 +682,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
                }
 
                if (l_RequestedReload.exchange(false)) {
-                       Log(LogInformation, "Application") << "Got reload command: Starting new instance.";
+                       Log(LogInformation, "Application")
+                               << "Got reload command: Starting new instance.";
 
 #ifdef HAVE_SYSTEMD
                        sd_notify(0, "RELOADING=1");
@@ -685,7 +694,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
                        if (nextWorker == -1) {
                                Log(LogCritical, "Application", "Found error in config: reloading aborted");
                        } else {
-                               Log(LogInformation, "Application") << "Reload done, old process shutting down. Child process with PID '" << nextWorker << "' is taking over.";
+                               Log(LogInformation, "Application")
+                                       << "Reload done, old process shutting down. Child process with PID '" << nextWorker << "' is taking over.";
 
                                (void)kill(currentWorker, SIGTERM);
 
@@ -698,7 +708,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
 #endif /* HAVE_SYSTEMD */
                                        }
 
-                                       Log(LogNotice, "cli") << "Waited for " << Utility::FormatDuration(Utility::GetTime() - start) << " on old process to exit.";
+                                       Log(LogNotice, "cli")
+                                               << "Waited for " << Utility::FormatDuration(Utility::GetTime() - start) << " on old process to exit.";
                                }
 
                                // Old instance shut down, allow the new one to continue working beyond config validation
@@ -714,7 +725,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
                }
 
                if (l_RequestedReopenLogs.exchange(false)) {
-                       Log(LogNotice, "cli") << "Got signal " << SIGUSR1 << ", forwarding to seemless worker (PID " << currentWorker << ")";
+                       Log(LogNotice, "cli")
+                               << "Got signal " << SIGUSR1 << ", forwarding to seemless worker (PID " << currentWorker << ")";
 
                        (void)kill(currentWorker, SIGUSR1);
                }
@@ -722,7 +734,8 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
                {
                        int status;
                        if (waitpid(currentWorker, &status, WNOHANG) > 0) {
-                               Log(LogNotice, "cli") << "Seemless worker (PID " << currentWorker << ") stopped, stopping as well";
+                               Log(LogNotice, "cli")
+                                       << "Seemless worker (PID " << currentWorker << ") stopped, stopping as well";
 
 #ifdef HAVE_SYSTEMD
                                if (!notifiedTermination) {