Skip to content

Commit

Permalink
Add App::isServerStarted function and replace
Browse files Browse the repository at this point in the history
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
  • Loading branch information
iwamatsu committed Feb 15, 2012
1 parent 21bde07 commit 1bc48fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion app.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class App {
void RestartServer();
void StopServer();

bool serverStarted;
// Lock functions
void GetLock();
void RemoveLock();

bool isServerStarted();

private:
void Login();
void Reboot();
Expand Down Expand Up @@ -80,6 +81,7 @@ class App {
Panel* LoginPanel;
int ServerPID;
const char* DisplayName;
bool serverStarted;

#ifdef USE_PAM
PAM::Authenticator pam;
Expand Down

0 comments on commit 1bc48fa

Please sign in to comment.