Browse Source

Add App::isServerStarted function and replace

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@206 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 12 years ago
parent
commit
9c46f74ead
2 changed files with 9 additions and 2 deletions
  1. 6 1
      app.cpp
  2. 3 1
      app.h

+ 6 - 1
app.cpp

@@ -112,7 +112,7 @@ int xioerror(Display *disp) {
 void CatchSignal(int sig) {
     cerr << APPNAME << ": unexpected signal " << sig << endl;
 
-    if (LoginApp->serverStarted)
+    if (LoginApp->isServerStarted())
         LoginApp->StopServer();
 
     LoginApp->RemoveLock();
@@ -1138,6 +1138,11 @@ void App::RemoveLock() {
     remove(cfg->getOption("lockfile").c_str());
 }
 
+// Get server start check flag.
+bool App::isServerStarted() {
+    return serverStarted;
+}
+
 // Redirect stdout and stderr to log file
 void App::OpenLog() {
     FILE *log = fopen (cfg->getOption("logfile").c_str(),"a");

+ 3 - 1
app.h

@@ -40,11 +40,12 @@ public:
     void RestartServer();
     void StopServer();
 
-	bool serverStarted;
     // Lock functions
     void GetLock();
     void RemoveLock();
 
+    bool isServerStarted();
+
 private:
     void Login();
     void Reboot();
@@ -80,6 +81,7 @@ private:
     Panel* LoginPanel;
     int ServerPID;
     const char* DisplayName;
+    bool serverStarted;
 
 #ifdef USE_PAM
 	PAM::Authenticator pam;