lichao
2021-05-19 96a894834650e219cdd9b4c9756f7b1790bcd838
box/center_main.cc
@@ -103,14 +103,18 @@
   auto &shm = BHomeShm();
   if (!CenterInit(shm)) {
      LOG_FATAL() << "init memory error.";
      auto msg = "init memory error.";
      LOG_FATAL() << msg;
      printf("%s\n", msg);
      exit(0);
   }
   GlobalInit(shm);
   InstanceFlag inst(shm, kCenterRunningFlag);
   if (!inst.TryStartAsFirstInstance()) {
      LOG_INFO() << "another instance is running, exit.";
      auto msg = "another instance is running, exit.";
      LOG_INFO() << msg;
      printf("%s\n", msg);
      return 0;
   }
@@ -121,7 +125,9 @@
   BHCenter center(shm);
   center.Start();
   LOG_INFO() << "center started ...";
   auto msg = "center started ...";
   LOG_INFO() << msg;
   printf("%s\n", msg);
   WaitForSignals({SIGINT, SIGTERM});
   center.Stop();
   LOG_INFO() << "center stopped.";